[build] Move shared and gradle-plugin into separate gradle builds
Platform libs build will be changed by a separate commit
This commit is contained in:
@@ -27,5 +27,5 @@ dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
||||
compile "org.jetbrains.kotlin:kotlin-compiler:$buildKotlinVersion"
|
||||
compile project(':Interop:Indexer')
|
||||
compile project(':shared')
|
||||
compile 'org.jetbrains.kotlin:kotlin-native-shared'
|
||||
}
|
||||
|
||||
@@ -147,10 +147,10 @@ dependencies {
|
||||
compilerCompile kotlinCompilerModule
|
||||
compilerCompile kotlinNativeInterop['llvm'].configuration
|
||||
compilerCompile kotlinNativeInterop['hash'].configuration
|
||||
compilerCompile project(':shared')
|
||||
compilerCompile 'org.jetbrains.kotlin:kotlin-native-shared'
|
||||
|
||||
cli_bcCompile "org.jetbrains.kotlin:kotlin-runtime:$buildKotlinVersion"
|
||||
cli_bcCompile project(':shared')
|
||||
cli_bcCompile 'org.jetbrains.kotlin:kotlin-native-shared'
|
||||
cli_bcCompile sourceSets.compiler.output
|
||||
|
||||
bc_frontendCompile kotlinCompilerModule
|
||||
|
||||
@@ -4,7 +4,7 @@ apply plugin: 'kotlin'
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
||||
compile project(path: ':backend.native', configuration: 'cli_bc')
|
||||
compile project(':shared')
|
||||
compile 'org.jetbrains.kotlin:kotlin-native-shared'
|
||||
compile 'junit:junit:4.12'
|
||||
}
|
||||
|
||||
|
||||
+11
-13
@@ -150,6 +150,12 @@ class PlatformInfo {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Add a task for gradle plugin uploading
|
||||
// TODO: And fix release readme: add info about compiler version and about new gradle-plugin uploading task
|
||||
task sharedJar {
|
||||
dependsOn gradle.includedBuild('shared').task(':jar')
|
||||
}
|
||||
|
||||
task dist_compiler(dependsOn: "distCompiler")
|
||||
task dist_runtime(dependsOn: "distRuntime")
|
||||
task cross_dist(dependsOn: "crossDist")
|
||||
@@ -159,7 +165,7 @@ task distCompiler(type: Copy) {
|
||||
dependsOn ':backend.native:jar'
|
||||
dependsOn ':utilities:jar'
|
||||
dependsOn ':klib:jar'
|
||||
dependsOn ':shared:jar'
|
||||
dependsOn ':sharedJar'
|
||||
|
||||
destinationDir distDir
|
||||
|
||||
@@ -215,7 +221,8 @@ task distCompiler(type: Copy) {
|
||||
into('konan/lib')
|
||||
}
|
||||
|
||||
from(project(':shared').file('build/libs')) {
|
||||
// TODO: Is there another way to specify a path to shared?
|
||||
from(file('shared/build/libs')) {
|
||||
into('konan/lib')
|
||||
}
|
||||
|
||||
@@ -440,18 +447,9 @@ task uploadBundle {
|
||||
}
|
||||
}
|
||||
|
||||
task performance(type: GradleBuild) {
|
||||
task performance {
|
||||
dependsOn 'dist'
|
||||
dependsOn ':tools:kotlin-native-gradle-plugin:jar'
|
||||
|
||||
dir = 'performance'
|
||||
tasks = ['build', 'bench']
|
||||
|
||||
doFirst {
|
||||
startParameter.projectProperties = [
|
||||
'konanPluginClasspath' : project(':tools:kotlin-native-gradle-plugin').tasks.getByName('jar').archivePath.canonicalPath,
|
||||
'exe_suffix': TargetManager.host.family.exeSuffix]
|
||||
}
|
||||
dependsOn ':performance:bench'
|
||||
}
|
||||
|
||||
task clean {
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
buildscript {
|
||||
def rootProperties = new Properties()
|
||||
rootProperties.load(new FileReader(project.file('../gradle.properties')))
|
||||
rootProperties.each {k, v -> ext.set(k, v)}
|
||||
repositories {
|
||||
|
||||
maven {
|
||||
//TODO: this path should be removed!!
|
||||
//TODO: this path should be removed!! But how? O_oc
|
||||
url "https://oss.sonatype.org/content/repositories/snapshots"
|
||||
}
|
||||
maven {
|
||||
url rootProperties.kotlinCompilerRepo
|
||||
url kotlinCompilerRepo
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinGradlePluginVersion"
|
||||
classpath files(project.file('../tools/kotlin-native-gradle-plugin/build/libs').listFiles().findAll{it.name.endsWith('.jar')}.collect().first().absolutePath)
|
||||
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$konanVersion"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +36,9 @@ apply plugin: 'kotlin'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'konan'
|
||||
|
||||
project.setProperty("konan.home", distDir)
|
||||
checkKonanCompiler.dependsOn ':dist'
|
||||
|
||||
konanArtifacts {
|
||||
program('Ring') {
|
||||
enableOptimizations true
|
||||
@@ -57,6 +57,7 @@ dependencies {
|
||||
}
|
||||
|
||||
task jvmRun(type: JavaExec) {
|
||||
dependsOn 'build'
|
||||
def output = new ByteArrayOutputStream()
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
main = "MainKt"
|
||||
@@ -74,6 +75,7 @@ private void dumpReport(String name, ByteArrayOutputStream output) {
|
||||
}
|
||||
|
||||
task konanRun(type: Exec) {
|
||||
dependsOn 'build'
|
||||
def output = new ByteArrayOutputStream()
|
||||
commandLine konanArtifacts.Ring.getByTarget('host').artifact.absolutePath, "$ringWarmup", "$iterations"
|
||||
standardOutput = output
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
konan.home=../dist
|
||||
@@ -21,4 +21,7 @@ include ':uikit'
|
||||
include ':win32'
|
||||
include ':videoplayer'
|
||||
include ':workers'
|
||||
includeBuild '../'
|
||||
// TODO: set up some rule to remove these strings in bundle
|
||||
includeBuild('../shared') { dependencySubstitution { substitute module('org.jetbrains.kotlin:kotlin-native-shared') with project(':') } }
|
||||
includeBuild '../tools/kotlin-native-gradle-plugin'
|
||||
|
||||
|
||||
+12
-2
@@ -26,6 +26,16 @@ include ':runtime'
|
||||
include ':common'
|
||||
include ':backend.native:tests'
|
||||
include ':backend.native:debugger-tests'
|
||||
include ':shared'
|
||||
include ':tools:kotlin-native-gradle-plugin'
|
||||
// TODO: remove
|
||||
// TODO: Use 'shared' build in buildSrc and all build scripts as a dependency (of a build script too)
|
||||
//include ':shared'
|
||||
//include ':tools:kotlin-native-gradle-plugin'
|
||||
include ':utilities'
|
||||
include ':performance'
|
||||
|
||||
includeBuild 'tools/kotlin-native-gradle-plugin'
|
||||
includeBuild('shared') {
|
||||
dependencySubstitution {
|
||||
substitute module('org.jetbrains.kotlin:kotlin-native-shared') with project(':')
|
||||
}
|
||||
}
|
||||
|
||||
+18
-1
@@ -15,11 +15,28 @@
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
apply from: "$rootDir/gradle/kotlinGradlePlugin.gradle"
|
||||
ext.mainBuildDir = file('../')
|
||||
|
||||
def rootProperties = new Properties()
|
||||
file("$mainBuildDir/gradle.properties").withReader {
|
||||
rootProperties.load(it)
|
||||
}
|
||||
rootProperties.each { k, v ->
|
||||
ext.set(k, v)
|
||||
}
|
||||
|
||||
apply from: "$mainBuildDir/gradle/kotlinGradlePlugin.gradle"
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url kotlinCompilerRepo
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
rootProject.name = "shared"
|
||||
@@ -20,7 +20,21 @@
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
apply from: "$rootDir/gradle/kotlinGradlePlugin.gradle"
|
||||
ext {
|
||||
mainBuildDir = file('../../') // TODO: move mainBuildDir into gradle.properties
|
||||
distDir = file("$mainBuildDir/dist")
|
||||
}
|
||||
|
||||
// TODO: Make a separate function?
|
||||
def rootProperties = new Properties()
|
||||
file("$mainBuildDir/gradle.properties").withReader {
|
||||
rootProperties.load(it)
|
||||
}
|
||||
rootProperties.each { k, v ->
|
||||
ext.set(k, v)
|
||||
}
|
||||
|
||||
apply from: "$mainBuildDir/gradle/kotlinGradlePlugin.gradle"
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
@@ -28,6 +42,7 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
|
||||
}
|
||||
}
|
||||
apply plugin: 'java'
|
||||
@@ -35,12 +50,16 @@ apply plugin: 'kotlin'
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'com.jfrog.bintray'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
group = 'org.jetbrains.kotlin'
|
||||
version = konanVersion
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url kotlinCompilerRepo
|
||||
}
|
||||
}
|
||||
|
||||
task pluginMetadata {
|
||||
@@ -60,10 +79,12 @@ task pluginMetadata {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':shared')
|
||||
compile "org.jetbrains.kotlin:kotlin-native-shared" // TODO: What about version?
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
||||
compile gradleApi()
|
||||
|
||||
shadow "org.jetbrains.kotlin:kotlin-native-shared"
|
||||
|
||||
testCompile gradleTestKit()
|
||||
testCompile 'junit:junit:4.12'
|
||||
testCompile('org.spockframework:spock-core:1.1-groovy-2.4') {
|
||||
@@ -89,19 +110,15 @@ test {
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
from (rootProject.findProject(':shared').sourceSets.main.output)
|
||||
}
|
||||
|
||||
processResources {
|
||||
expand('konanVersion': konanVersion)
|
||||
from(rootProject.project(':utilities').file('env_blacklist'))
|
||||
from(file("$mainBuildDir/utilities/env_blacklist"))
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
gradlePlugin(MavenPublication) {
|
||||
artifact jar
|
||||
artifact shadowJar
|
||||
pom.withXml { XmlProvider xml ->
|
||||
def stdlibDep = xml.asNode().appendNode("dependencies").appendNode("dependency")
|
||||
stdlibDep.appendNode("groupId", "org.jetbrains.kotlin")
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
rootProject.name = "kotlin-native-gradle-plugin"
|
||||
Reference in New Issue
Block a user