[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-stdlib:$buildKotlinVersion"
|
||||||
compile "org.jetbrains.kotlin:kotlin-compiler:$buildKotlinVersion"
|
compile "org.jetbrains.kotlin:kotlin-compiler:$buildKotlinVersion"
|
||||||
compile project(':Interop:Indexer')
|
compile project(':Interop:Indexer')
|
||||||
compile project(':shared')
|
compile 'org.jetbrains.kotlin:kotlin-native-shared'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,10 +147,10 @@ dependencies {
|
|||||||
compilerCompile kotlinCompilerModule
|
compilerCompile kotlinCompilerModule
|
||||||
compilerCompile kotlinNativeInterop['llvm'].configuration
|
compilerCompile kotlinNativeInterop['llvm'].configuration
|
||||||
compilerCompile kotlinNativeInterop['hash'].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 "org.jetbrains.kotlin:kotlin-runtime:$buildKotlinVersion"
|
||||||
cli_bcCompile project(':shared')
|
cli_bcCompile 'org.jetbrains.kotlin:kotlin-native-shared'
|
||||||
cli_bcCompile sourceSets.compiler.output
|
cli_bcCompile sourceSets.compiler.output
|
||||||
|
|
||||||
bc_frontendCompile kotlinCompilerModule
|
bc_frontendCompile kotlinCompilerModule
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ apply plugin: 'kotlin'
|
|||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
||||||
compile project(path: ':backend.native', configuration: 'cli_bc')
|
compile project(path: ':backend.native', configuration: 'cli_bc')
|
||||||
compile project(':shared')
|
compile 'org.jetbrains.kotlin:kotlin-native-shared'
|
||||||
compile 'junit:junit:4.12'
|
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_compiler(dependsOn: "distCompiler")
|
||||||
task dist_runtime(dependsOn: "distRuntime")
|
task dist_runtime(dependsOn: "distRuntime")
|
||||||
task cross_dist(dependsOn: "crossDist")
|
task cross_dist(dependsOn: "crossDist")
|
||||||
@@ -159,7 +165,7 @@ task distCompiler(type: Copy) {
|
|||||||
dependsOn ':backend.native:jar'
|
dependsOn ':backend.native:jar'
|
||||||
dependsOn ':utilities:jar'
|
dependsOn ':utilities:jar'
|
||||||
dependsOn ':klib:jar'
|
dependsOn ':klib:jar'
|
||||||
dependsOn ':shared:jar'
|
dependsOn ':sharedJar'
|
||||||
|
|
||||||
destinationDir distDir
|
destinationDir distDir
|
||||||
|
|
||||||
@@ -215,7 +221,8 @@ task distCompiler(type: Copy) {
|
|||||||
into('konan/lib')
|
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')
|
into('konan/lib')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,18 +447,9 @@ task uploadBundle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task performance(type: GradleBuild) {
|
task performance {
|
||||||
dependsOn 'dist'
|
dependsOn 'dist'
|
||||||
dependsOn ':tools:kotlin-native-gradle-plugin:jar'
|
dependsOn ':performance:bench'
|
||||||
|
|
||||||
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]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean {
|
task clean {
|
||||||
|
|||||||
@@ -1,22 +1,19 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
def rootProperties = new Properties()
|
|
||||||
rootProperties.load(new FileReader(project.file('../gradle.properties')))
|
|
||||||
rootProperties.each {k, v -> ext.set(k, v)}
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|
||||||
maven {
|
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"
|
url "https://oss.sonatype.org/content/repositories/snapshots"
|
||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
url rootProperties.kotlinCompilerRepo
|
url kotlinCompilerRepo
|
||||||
}
|
}
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinGradlePluginVersion"
|
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: 'application'
|
||||||
apply plugin: 'konan'
|
apply plugin: 'konan'
|
||||||
|
|
||||||
|
project.setProperty("konan.home", distDir)
|
||||||
|
checkKonanCompiler.dependsOn ':dist'
|
||||||
|
|
||||||
konanArtifacts {
|
konanArtifacts {
|
||||||
program('Ring') {
|
program('Ring') {
|
||||||
enableOptimizations true
|
enableOptimizations true
|
||||||
@@ -57,6 +57,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task jvmRun(type: JavaExec) {
|
task jvmRun(type: JavaExec) {
|
||||||
|
dependsOn 'build'
|
||||||
def output = new ByteArrayOutputStream()
|
def output = new ByteArrayOutputStream()
|
||||||
classpath sourceSets.main.runtimeClasspath
|
classpath sourceSets.main.runtimeClasspath
|
||||||
main = "MainKt"
|
main = "MainKt"
|
||||||
@@ -74,6 +75,7 @@ private void dumpReport(String name, ByteArrayOutputStream output) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task konanRun(type: Exec) {
|
task konanRun(type: Exec) {
|
||||||
|
dependsOn 'build'
|
||||||
def output = new ByteArrayOutputStream()
|
def output = new ByteArrayOutputStream()
|
||||||
commandLine konanArtifacts.Ring.getByTarget('host').artifact.absolutePath, "$ringWarmup", "$iterations"
|
commandLine konanArtifacts.Ring.getByTarget('host').artifact.absolutePath, "$ringWarmup", "$iterations"
|
||||||
standardOutput = output
|
standardOutput = output
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
konan.home=../dist
|
|
||||||
@@ -21,4 +21,7 @@ include ':uikit'
|
|||||||
include ':win32'
|
include ':win32'
|
||||||
include ':videoplayer'
|
include ':videoplayer'
|
||||||
include ':workers'
|
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 ':common'
|
||||||
include ':backend.native:tests'
|
include ':backend.native:tests'
|
||||||
include ':backend.native:debugger-tests'
|
include ':backend.native:debugger-tests'
|
||||||
include ':shared'
|
// TODO: remove
|
||||||
include ':tools:kotlin-native-gradle-plugin'
|
// 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 ':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 {
|
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'
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
url kotlinCompilerRepo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
rootProject.name = "shared"
|
||||||
@@ -20,7 +20,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
buildscript {
|
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 {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
@@ -28,6 +42,7 @@ buildscript {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
|
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
|
||||||
|
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
@@ -35,12 +50,16 @@ apply plugin: 'kotlin'
|
|||||||
apply plugin: 'groovy'
|
apply plugin: 'groovy'
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
apply plugin: 'com.jfrog.bintray'
|
apply plugin: 'com.jfrog.bintray'
|
||||||
|
apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
|
|
||||||
group = 'org.jetbrains.kotlin'
|
group = 'org.jetbrains.kotlin'
|
||||||
version = konanVersion
|
version = konanVersion
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
url kotlinCompilerRepo
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task pluginMetadata {
|
task pluginMetadata {
|
||||||
@@ -60,10 +79,12 @@ task pluginMetadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':shared')
|
compile "org.jetbrains.kotlin:kotlin-native-shared" // TODO: What about version?
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
||||||
compile gradleApi()
|
compile gradleApi()
|
||||||
|
|
||||||
|
shadow "org.jetbrains.kotlin:kotlin-native-shared"
|
||||||
|
|
||||||
testCompile gradleTestKit()
|
testCompile gradleTestKit()
|
||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
testCompile('org.spockframework:spock-core:1.1-groovy-2.4') {
|
testCompile('org.spockframework:spock-core:1.1-groovy-2.4') {
|
||||||
@@ -89,19 +110,15 @@ test {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
|
||||||
from (rootProject.findProject(':shared').sourceSets.main.output)
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
expand('konanVersion': konanVersion)
|
expand('konanVersion': konanVersion)
|
||||||
from(rootProject.project(':utilities').file('env_blacklist'))
|
from(file("$mainBuildDir/utilities/env_blacklist"))
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
gradlePlugin(MavenPublication) {
|
gradlePlugin(MavenPublication) {
|
||||||
artifact jar
|
artifact shadowJar
|
||||||
pom.withXml { XmlProvider xml ->
|
pom.withXml { XmlProvider xml ->
|
||||||
def stdlibDep = xml.asNode().appendNode("dependencies").appendNode("dependency")
|
def stdlibDep = xml.asNode().appendNode("dependencies").appendNode("dependency")
|
||||||
stdlibDep.appendNode("groupId", "org.jetbrains.kotlin")
|
stdlibDep.appendNode("groupId", "org.jetbrains.kotlin")
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
rootProject.name = "kotlin-native-gradle-plugin"
|
||||||
Reference in New Issue
Block a user