build: Distribute 'shared' as a separate jar

This commit is contained in:
Ilya Matveev
2017-08-18 13:04:40 +07:00
committed by ilmat192
parent de8cc297f2
commit fb15992546
4 changed files with 50 additions and 46 deletions
+41 -41
View File
@@ -52,25 +52,24 @@ allprojects {
sourceSets {
compiler {
proto.srcDir 'compiler/ir/backend.native/src/'
java {
srcDir 'compiler/ir/backend.native/src/'
srcDir 'build/renamed/source/proto/compiler/java'
}
kotlin {
srcDir 'compiler/ir/backend.native/src/'
srcDir "${rootProject.projectDir}/shared/src/main/kotlin"
}
resources.srcDir 'compiler/ir/backend.native/resources/'
proto.srcDir 'compiler/ir/backend.native/src/'
java {
srcDir 'compiler/ir/backend.native/src/'
srcDir 'build/renamed/source/proto/compiler/java'
}
kotlin {
srcDir 'compiler/ir/backend.native/src/'
}
resources.srcDir 'compiler/ir/backend.native/resources/'
}
cli_bc {
java.srcDir 'cli.bc/src'
kotlin.srcDir 'cli.bc/src'
java.srcDir 'cli.bc/src'
kotlin.srcDir 'cli.bc/src'
}
bc_frontend {
java.srcDir 'bc.frontend/src'
kotlin.srcDir 'bc.frontend/src'
}
java.srcDir 'bc.frontend/src'
kotlin.srcDir 'bc.frontend/src'
}
}
compileCompilerKotlin {
@@ -96,26 +95,26 @@ task renamePackage(type: Copy) {
}
kotlinNativeInterop {
llvm {
dependsOn ":llvmDebugInfoC:debugInfoStaticLibrary"
defFile 'llvm.def'
compilerOpts "-fPIC", "-I$llvmDir/include", "-I${project(':llvmDebugInfoC').projectDir}/src/main/include"
linkerOpts "-L$llvmDir/lib", "-L${project(':llvmDebugInfoC').buildDir}/libs/debugInfo/static"
}
llvm {
dependsOn ":llvmDebugInfoC:debugInfoStaticLibrary"
defFile 'llvm.def'
compilerOpts "-fPIC", "-I$llvmDir/include", "-I${project(':llvmDebugInfoC').projectDir}/src/main/include"
linkerOpts "-L$llvmDir/lib", "-L${project(':llvmDebugInfoC').buildDir}/libs/debugInfo/static"
}
hash { // TODO: copy-pasted from ':common:compileHash'
compilerOpts '-fPIC'
linkerOpts '-fPIC'
linker 'clang++'
linkOutputs ":common:${hostName}Hash"
hash { // TODO: copy-pasted from ':common:compileHash'
compilerOpts '-fPIC'
linkerOpts '-fPIC'
linker 'clang++'
linkOutputs ":common:${hostName}Hash"
headers fileTree('../common/src/hash/headers') {
include '**/*.h'
include '**/*.hpp'
}
headers fileTree('../common/src/hash/headers') {
include '**/*.h'
include '**/*.hpp'
}
pkg 'org.jetbrains.kotlin.backend.konan.hash'
}
pkg 'org.jetbrains.kotlin.backend.konan.hash'
}
}
@@ -129,19 +128,20 @@ configurations {
dependencies {
compilerCompile "com.google.protobuf:protobuf-java:${protobufVersion}"
compilerCompile "com.google.protobuf:protobuf-java:${protobufVersion}"
compilerCompile kotlinCompilerModule
compilerCompile kotlinNativeInterop['llvm'].configuration
compilerCompile kotlinNativeInterop['hash'].configuration
compilerCompile project(':shared')
compilerCompile kotlinCompilerModule
compilerCompile kotlinNativeInterop['llvm'].configuration
compilerCompile kotlinNativeInterop['hash'].configuration
compilerCompile project(':shared')
cli_bcCompile "org.jetbrains.kotlin:kotlin-runtime:$kotlin_version"
cli_bcCompile sourceSets.compiler.output
cli_bcCompile "org.jetbrains.kotlin:kotlin-runtime:$kotlin_version"
cli_bcCompile project(':shared')
cli_bcCompile sourceSets.compiler.output
bc_frontendCompile kotlinCompilerModule
bc_frontendCompile kotlinCompilerModule
cli_bc sourceSets.cli_bc.output
cli_bc sourceSets.cli_bc.output
}
+5
View File
@@ -146,6 +146,7 @@ task distCompiler(type: Copy) {
dependsOn ':tools:helpers:jar'
dependsOn ':utilities:jar'
dependsOn ':klib:jar'
dependsOn ':shared:jar'
destinationDir file('dist')
@@ -197,6 +198,10 @@ task distCompiler(type: Copy) {
into('konan/lib')
}
from(project(':shared').file('build/libs')) {
into('konan/lib')
}
from(file('cmd')) {
fileMode(0755)
into('bin')
+2 -4
View File
@@ -26,10 +26,8 @@ buildscript {
apply plugin: 'kotlin'
compileKotlin {
// We reuse the source code from the Project in buildSrc.
source "$projectDir/../../shared"
}
// We reuse the source code from the Project in buildSrc.
sourceSets.main.kotlin.srcDirs = ["$projectDir/../../shared"]
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+2 -1
View File
@@ -80,9 +80,10 @@ STUB_GENERATOR_JAR="${KONAN_HOME}/konan/lib/StubGenerator.jar"
INTEROP_INDEXER_JAR="${KONAN_HOME}/konan/lib/Indexer.jar"
INTEROP_JAR="${KONAN_HOME}/konan/lib/Runtime.jar"
HELPERS_JAR="${KONAN_HOME}/konan/lib/helpers.jar"
SHARED_JAR="${KONAN_HOME}/konan/lib/shared.jar"
KLIB_JAR="${KONAN_HOME}/konan/lib/klib.jar"
UTILITIES_JAR="${KONAN_HOME}/konan/lib/utilities.jar"
KONAN_CLASSPATH="$KOTLIN_JAR:$INTEROP_JAR:$STUB_GENERATOR_JAR:$INTEROP_INDEXER_JAR:$KONAN_JAR:$HELPERS_JAR:$KLIB_JAR:$UTILITIES_JAR"
KONAN_CLASSPATH="$KOTLIN_JAR:$INTEROP_JAR:$STUB_GENERATOR_JAR:$INTEROP_INDEXER_JAR:$KONAN_JAR:$HELPERS_JAR:$KLIB_JAR:$UTILITIES_JAR:$SHARED_JAR"
TOOL_CLASS=org.jetbrains.kotlin.cli.utilities.MainKt
LIBCLANG_DISABLE_CRASH_RECOVERY=1 \