build: Distribute 'shared' as a separate jar
This commit is contained in:
+41
-41
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user