[build] Improve composite build
This commit is contained in:
+1
-2
@@ -221,8 +221,7 @@ task distCompiler(type: Copy) {
|
||||
into('konan/lib')
|
||||
}
|
||||
|
||||
// TODO: Is there another way to specify a path to shared?
|
||||
from(file('shared/build/libs')) {
|
||||
from(file("${gradle.includedBuild('shared').projectDir}/build/libs")) {
|
||||
into('konan/lib')
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ dependencies {
|
||||
compile gradleApi()
|
||||
compile localGroovy()
|
||||
compile group: 'com.ullink.slack', name: 'simpleslackapi', version: '0.6.0'
|
||||
// An artifact from the included build 'shared' cannot be used here due to https://github.com/gradle/gradle/issues/3768
|
||||
// TODO: Remove this hack when the bug is fixed
|
||||
compile project(':shared')
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
if (!project.hasProperty("rootBuildDirectory")) {
|
||||
throw new GradleException('Please ensure the "rootBuildDirectory" property is defined before applying this script.')
|
||||
}
|
||||
|
||||
ext.distDir = file("$rootBuildDirectory/dist")
|
||||
|
||||
def rootProperties = new Properties()
|
||||
def rootDir = file(rootBuildDirectory).absolutePath
|
||||
file("$rootDir/gradle.properties").withReader {
|
||||
rootProperties.load(it)
|
||||
}
|
||||
rootProperties.each { k, v ->
|
||||
ext.set(k, v)
|
||||
}
|
||||
@@ -2,7 +2,7 @@ buildscript {
|
||||
repositories {
|
||||
|
||||
maven {
|
||||
//TODO: this path should be removed!! But how? O_oc
|
||||
//TODO: this path should be removed!!
|
||||
url "https://oss.sonatype.org/content/repositories/snapshots"
|
||||
}
|
||||
maven {
|
||||
|
||||
+17
-10
@@ -18,15 +18,13 @@ buildscript {
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin"
|
||||
}
|
||||
|
||||
ext.konanHome = distDir.absolutePath
|
||||
ext.jvmArgs = project.findProperty("platformLibsJvmArgs") ?: "-Xmx6G"
|
||||
ext.setProperty("konan.home", konanHome)
|
||||
ext.setProperty("konan.jvmArgs", jvmArgs)
|
||||
}
|
||||
|
||||
String konanHome = distDir.absolutePath
|
||||
String jvmArgs = project.findProperty("platformLibsJvmArgs") ?: "-Xmx6G"
|
||||
ext.setProperty("konan.home", konanHome)
|
||||
ext.setProperty("konan.jvmArgs", jvmArgs)
|
||||
// TODO: split jvmArgs in gradle plugin
|
||||
|
||||
|
||||
//#region Util functions.
|
||||
private ArrayList<DefFile> targetDefFiles(String target) {
|
||||
def platform = targetToPlatform(target)
|
||||
@@ -59,8 +57,11 @@ private String defFileToInstallTaskName(String target, String name) {
|
||||
|
||||
// TODO: Fix the report in performance project
|
||||
class KlibInstall extends Exec {
|
||||
@InputFile
|
||||
public File klib
|
||||
public File repo
|
||||
|
||||
@Input
|
||||
public String target
|
||||
|
||||
@Override
|
||||
@@ -80,19 +81,25 @@ class KlibInstall extends Exec {
|
||||
'-repository', repo.absolutePath
|
||||
}
|
||||
}
|
||||
|
||||
@OutputDirectory
|
||||
File getInstallDir() {
|
||||
def klibName = klib.name.take(klib.name.lastIndexOf('.'))
|
||||
return project.file("$repo.absolutePath/$klibName")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
println(targetList)
|
||||
|
||||
targetList.each { target ->
|
||||
|
||||
ArrayList<Task> installTasks = []
|
||||
|
||||
targetDefFiles(target).each { df ->
|
||||
def libName = defFileToLibName(target, df.name)
|
||||
def installTaskName = defFileToLibName(target, df.name)
|
||||
def installTaskName = defFileToInstallTaskName(target, df.name)
|
||||
|
||||
konan.targets = [target] // TODO: Support custom targets in gradle plugin.
|
||||
konanArtifacts {
|
||||
|
||||
@@ -26,10 +26,6 @@ include ':runtime'
|
||||
include ':common'
|
||||
include ':backend.native:tests'
|
||||
include ':backend.native:debugger-tests'
|
||||
// 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'
|
||||
include ':platformLibs'
|
||||
|
||||
+3
-10
@@ -15,17 +15,10 @@
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
ext.mainBuildDir = file('../')
|
||||
ext.rootBuildDirectory = 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 from: "$rootBuildDirectory/gradle/loadRootProperties.gradle"
|
||||
apply from: "$rootBuildDirectory/gradle/kotlinGradlePlugin.gradle"
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
@@ -20,21 +20,10 @@
|
||||
*/
|
||||
|
||||
buildscript {
|
||||
ext {
|
||||
mainBuildDir = file('../../') // TODO: move mainBuildDir into gradle.properties
|
||||
distDir = file("$mainBuildDir/dist")
|
||||
}
|
||||
ext.rootBuildDirectory = file('../../')
|
||||
|
||||
// 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"
|
||||
apply from: "$rootBuildDirectory/gradle/loadRootProperties.gradle"
|
||||
apply from: "$rootBuildDirectory/gradle/kotlinGradlePlugin.gradle"
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
@@ -79,7 +68,7 @@ task pluginMetadata {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-native-shared" // TODO: What about version?
|
||||
compile 'org.jetbrains.kotlin:kotlin-native-shared'
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
|
||||
compile gradleApi()
|
||||
|
||||
@@ -112,7 +101,7 @@ test {
|
||||
|
||||
processResources {
|
||||
expand('konanVersion': konanVersion)
|
||||
from(file("$mainBuildDir/utilities/env_blacklist"))
|
||||
from(file("$rootBuildDirectory/utilities/env_blacklist"))
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
||||
Reference in New Issue
Block a user