+1
-1
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.konan.*
|
||||
// Run './gradlew wrapper --gradle-version <version>' to update all the wrappers.
|
||||
apply plugin: org.jetbrains.kotlin.GradleWrappers
|
||||
|
||||
wrappers.projects = ['samples', 'samples/calculator', 'samples/androidNativeActivity']
|
||||
wrappers.projects = ['samples', 'samples/calculator', 'samples/androidNativeActivity', 'samples/curl']
|
||||
wrapper.distributionType = Wrapper.DistributionType.ALL
|
||||
|
||||
defaultTasks 'clean', 'dist'
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://cache-redirector.jetbrains.com/services.gradle.org/distributions/gradle-4.7-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
BIN
Binary file not shown.
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
BIN
Binary file not shown.
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import org.jetbrains.kotlin.konan.KonanVersion
|
||||
import org.jetbrains.kotlin.konan.MetaVersion
|
||||
|
||||
/**
|
||||
* One may use bintrayUser/bintrayKey project properties or BINTRAY_USER/BINTRAY_KEY environment variables to upload
|
||||
* built plugin to bintray repository.
|
||||
@@ -36,7 +33,6 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
|
||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.0'
|
||||
}
|
||||
@@ -55,10 +51,19 @@ apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
group = 'org.jetbrains.kotlin'
|
||||
|
||||
if (KonanVersion.Companion.CURRENT.meta == MetaVersion.RELEASE) {
|
||||
// With Gradle 4.10 we are no longer able to depend on
|
||||
// a 'shared' build included into the root one and use the KonanVersion API provided
|
||||
// by it. So we have to manually construct the version.
|
||||
// TODO: Remove this code when 'shared' is built separately (from a separate repo).
|
||||
def meta = findProperty('konanMetaVersion') ?: 'dev'
|
||||
if (meta == 'release') {
|
||||
version = kotlinVersion
|
||||
} else {
|
||||
version = "$kotlinVersion-native-${KonanVersion.Companion.CURRENT.toString()}"
|
||||
def buildNumber = findProperty("build.number")?.tokenize('-')?.get(2)
|
||||
version = "$kotlinVersion-native-$konanVersion-$meta"
|
||||
if (buildNumber != null) {
|
||||
version += "-$buildNumber"
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -132,7 +137,21 @@ jar {
|
||||
|
||||
pluginUnderTestMetadata {
|
||||
dependsOn shadowJar
|
||||
pluginClasspath = files(shadowJar.archivePath) + configurations.shadow
|
||||
doLast {
|
||||
// Since Gradle 4.10 it isn't possible to edit the pluginUnderTest classpath.
|
||||
// So we have to manually set the implementation-classpath to get the output fat-jar.
|
||||
def pluginMetadata = outputDirectory.get().file(PluginUnderTestMetadata.METADATA_FILE_NAME).getAsFile()
|
||||
def classpath = files(shadowJar.archivePath) + configurations.shadow
|
||||
new Properties().with { properties ->
|
||||
pluginMetadata.withInputStream {
|
||||
properties.load(it)
|
||||
}
|
||||
properties.setProperty(PluginUnderTestMetadata.IMPLEMENTATION_CLASSPATH_PROP_KEY , classpath.asPath)
|
||||
pluginMetadata.withOutputStream {
|
||||
properties.store(it, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
rootProject.name = "kotlin-native-gradle-plugin"
|
||||
// A hack to run the gradle plugin build not from the root build without
|
||||
// specifying '--include-build ../../shared' in the command line.
|
||||
if (gradle.parent == null) {
|
||||
includeBuild '../../shared'
|
||||
}
|
||||
includeBuild '../../shared'
|
||||
|
||||
+2
-4
@@ -20,10 +20,7 @@ import groovy.lang.Closure
|
||||
import org.gradle.api.Action
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.Configuration
|
||||
import org.gradle.api.artifacts.DependencyConstraint
|
||||
import org.gradle.api.artifacts.ModuleDependency
|
||||
import org.gradle.api.artifacts.PublishArtifact
|
||||
import org.gradle.api.artifacts.*
|
||||
import org.gradle.api.attributes.Attribute
|
||||
import org.gradle.api.attributes.AttributeContainer
|
||||
import org.gradle.api.attributes.Usage
|
||||
@@ -129,6 +126,7 @@ abstract class KonanArtifactTask: KonanTargetableTask(), KonanArtifactSpec {
|
||||
override fun getDependencyConstraints(): MutableSet<out DependencyConstraint> = mutableSetOf()
|
||||
override fun getArtifacts(): MutableSet<out PublishArtifact> = platformConfiguration.allArtifacts
|
||||
override fun getAttributes(): AttributeContainer = platformConfiguration.attributes
|
||||
override fun getGlobalExcludes(): Set<ExcludeRule> = emptySet()
|
||||
}, platformConfiguration.allArtifacts, platformConfiguration)
|
||||
konanSoftwareComponent.addVariant(NativeVariantIdentity(
|
||||
variantName,
|
||||
|
||||
@@ -65,8 +65,8 @@ class ExperimentalPluginTests {
|
||||
}
|
||||
val assembleResult = project.createRunner().withArguments("assemble").build()
|
||||
|
||||
assertEquals(TaskOutcome.SUCCESS, assembleResult.task(":compileDebugKotlinNative")?.outcome)
|
||||
assertTrue(projectDirectory.resolve("build/exe/main/debug/test.$exeSuffix").exists())
|
||||
assertEquals(TaskOutcome.SUCCESS, assembleResult.task(":compileDebugExecutableKotlinNative")?.outcome)
|
||||
assertTrue(projectDirectory.resolve("build/exe/main/debug/executable/test.$exeSuffix").exists())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user