Merge pull request #19 from bnorm/kotlin-native

Kotlin/Native
This commit is contained in:
Brian Norman
2020-08-29 19:01:33 -05:00
committed by GitHub
23 changed files with 147 additions and 57 deletions
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+2
View File
@@ -82,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
Vendored
+4 -18
View File
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,28 +64,14 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
@@ -34,7 +34,13 @@ class PowerAssertGradlePlugin : KotlinCompilerPluginSupportPlugin {
override fun getPluginArtifact(): SubpluginArtifact = SubpluginArtifact(
groupId = "com.bnorm.power",
artifactId = "kotlin-power-assert",
artifactId = "kotlin-power-assert-plugin",
version = "0.5.0-SNAPSHOT"
)
override fun getPluginArtifactForNative(): SubpluginArtifact = SubpluginArtifact(
groupId = "com.bnorm.power",
artifactId = "kotlin-power-assert-plugin-native",
version = "0.5.0-SNAPSHOT"
)
@@ -0,0 +1 @@
src/
@@ -0,0 +1,120 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
kotlin("kapt")
id("org.jetbrains.dokka")
signing
`maven-publish`
}
dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-compiler")
kapt("com.google.auto.service:auto-service:1.0-rc6")
compileOnly("com.google.auto.service:auto-service-annotations:1.0-rc6")
}
tasks.named("compileKotlin") { dependsOn("syncSource") }
tasks.register<Sync>("syncSource") {
from(project(":kotlin-power-assert-plugin").sourceSets.main.get().allSource)
into("src/main/kotlin")
filter {
// Replace shadowed imports from kotlin-power-assert-plugin
when (it) {
"import org.jetbrains.kotlin.com.intellij.mock.MockProject" -> "import com.intellij.mock.MockProject"
else -> it
}
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.dokka {
outputFormat = "html"
outputDirectory = "$buildDir/javadoc"
}
tasks.register("sourcesJar", Jar::class) {
group = "build"
description = "Assembles Kotlin sources"
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
dependsOn(tasks.classes)
}
tasks.register("dokkaJar", Jar::class) {
group = "documentation"
description = "Assembles Kotlin docs with Dokka"
archiveClassifier.set("javadoc")
from(tasks.dokka)
dependsOn(tasks.dokka)
}
signing {
setRequired(provider { gradle.taskGraph.hasTask("publish") })
sign(publishing.publications)
}
publishing {
publications {
create<MavenPublication>("default") {
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["dokkaJar"])
pom {
name.set(project.name)
description.set("Kotlin compiler plugin to enable power assertions in the Kotlin programming language")
url.set("https://github.com/bnorm/kotlin-power-assert")
licenses {
license {
name.set("Apache License 2.0")
url.set("https://github.com/bnorm/kotlin-power-assert/blob/master/LICENSE.txt")
}
}
scm {
url.set("https://github.com/bnorm/kotlin-power-assert")
connection.set("scm:git:git://github.com/bnorm/kotlin-power-assert.git")
}
developers {
developer {
name.set("Brian Norman")
url.set("https://github.com/bnorm")
}
}
}
}
}
repositories {
if (
hasProperty("sonatypeUsername") &&
hasProperty("sonatypePassword") &&
hasProperty("sonatypeSnapshotUrl") &&
hasProperty("sonatypeReleaseUrl")
) {
maven {
val url = when {
"SNAPSHOT" in version.toString() -> property("sonatypeSnapshotUrl")
else -> property("sonatypeReleaseUrl")
} as String
setUrl(url)
credentials {
username = property("sonatypeUsername") as String
password = property("sonatypePassword") as String
}
}
}
maven {
name = "test"
setUrl("file://${rootProject.buildDir}/localMaven")
}
}
}
@@ -10,7 +10,6 @@ plugins {
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
compileOnly("org.jetbrains.kotlin:kotlin-compiler-embeddable")
kapt("com.google.auto.service:auto-service:1.0-rc6")
+1 -8
View File
@@ -1,19 +1,12 @@
buildscript {
dependencies {
classpath("gradle.plugin.com.bnorm.power:kotlin-power-assert-gradle:0.4.0")
}
}
plugins {
kotlin("multiplatform") version "1.4.0"
id("com.bnorm.power.kotlin-power-assert") version "0.4.0"
}
apply(plugin = "com.bnorm.power.kotlin-power-assert")
repositories {
mavenCentral()
}
kotlin {
jvm {
compilations.all {
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+2
View File
@@ -82,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
+4 -18
View File
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,28 +64,14 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
+2 -8
View File
@@ -1,9 +1,3 @@
rootProject.name = "sample"
rootProject.name = "kotlin-power-assert-sample"
includeBuild("..") {
dependencySubstitution {
substitute(module("com.bnorm.power:kotlin-power-assert")).with(project(":kotlin-power-assert"))
substitute(module("com.bnorm.power:kotlin-power-assert-gradle")).with(project(":kotlin-power-assert-gradle"))
substitute(module("gradle.plugin.com.bnorm.power:kotlin-power-assert-gradle")).with(project(":kotlin-power-assert-gradle"))
}
}
includeBuild("..")
+2 -1
View File
@@ -1,4 +1,5 @@
rootProject.name = "kotlin-power-assert"
include(":kotlin-power-assert")
include(":kotlin-power-assert-gradle")
include(":kotlin-power-assert-plugin")
include(":kotlin-power-assert-plugin-native")