Skip to content

Commit

Permalink
Revert "Depend on kotlin-native-shared from a separate repo"
Browse files Browse the repository at this point in the history
This reverts commit a237092.
  • Loading branch information
ilmat192 committed May 30, 2019
1 parent 99561ab commit 5745b31
Show file tree
Hide file tree
Showing 79 changed files with 4,197 additions and 255 deletions.
2 changes: 1 addition & 1 deletion Interop/Indexer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ buildscript {
ext.rootBuildDirectory = file('../..')

apply from: "$rootBuildDirectory/gradle/kotlinGradlePlugin.gradle"
apply from: "$rootBuildDirectory/gradle/kotlinNativeShared.gradle"

dependencies {
classpath "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
}
}
apply plugin: 'kotlin'
Expand Down
2 changes: 1 addition & 1 deletion Interop/Runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ buildscript {
ext.rootBuildDirectory = file('../..')

apply from: "$rootBuildDirectory/gradle/kotlinGradlePlugin.gradle"
apply from: "$rootBuildDirectory/gradle/kotlinNativeShared.gradle"

dependencies {
classpath "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
}
}
import org.jetbrains.kotlin.konan.target.ClangArgs
Expand Down
2 changes: 1 addition & 1 deletion Interop/StubGenerator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
compile "org.jetbrains.kotlin:kotlin-compiler:$buildKotlinVersion"
compile project(':Interop:Indexer')
compile kotlinNativeSharedModule
compile "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
}

compileKotlin {
Expand Down
8 changes: 3 additions & 5 deletions backend.native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ configurations {
kotlin_stdlib_jar
kotlin_reflect_jar
kotlin_script_runtime_jar
kotlin_native_shared_jar
trove4j_jar
kotlinCommonSources

Expand All @@ -132,7 +131,6 @@ dependencies {
kotlin_stdlib_jar "$kotlinStdLibModule@jar"
kotlin_reflect_jar "$kotlinReflectModule@jar"
kotlin_script_runtime_jar "$kotlinScriptRuntimeModule@jar"
kotlin_native_shared_jar "$kotlinNativeSharedModule@jar"

[kotlinCommonStdlibModule, kotlinTestCommonModule, kotlinTestAnnotationsCommonModule].each {
kotlinCommonSources(it) { transitive = false }
Expand All @@ -143,11 +141,11 @@ dependencies {
compilerCompile kotlinCompilerModule
compilerCompile kotlinNativeInterop['llvm'].configuration
compilerCompile kotlinNativeInterop['hash'].configuration
compilerCompile kotlinNativeSharedModule
compilerCompile "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
compilerCompile "org.jetbrains.kotlin:konan.serializer:$konanVersion"

cli_bcCompile kotlinCompilerModule
cli_bcCompile kotlinNativeSharedModule
cli_bcCompile "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
cli_bcCompile sourceSets.compiler.output
cli_bcCompile "org.jetbrains.kotlin:konan.serializer:$konanVersion"

Expand Down Expand Up @@ -234,7 +232,7 @@ jar {
dependsOn ':runtime:hostRuntime', 'external_jars'
}

def externalJars = ['compiler', 'stdlib', 'reflect', 'script_runtime', 'native_shared']
def externalJars = ['compiler', 'stdlib', 'reflect', 'script_runtime']

task trove4jCopy(type: Copy) {
from configurations.getByName("trove4j_jar") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParser
import org.jetbrains.kotlin.config.CommonConfigurationKeys
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.config.Services
import org.jetbrains.kotlin.konan.CURRENT
import org.jetbrains.kotlin.konan.KonanVersion
import org.jetbrains.kotlin.konan.file.File
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ import org.jetbrains.kotlin.cli.common.messages.GroupingMessageCollector
import org.jetbrains.kotlin.config.CommonConfigurationKeys
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.konan.*
import org.jetbrains.kotlin.konan.TempFiles
import org.jetbrains.kotlin.konan.file.File
import org.jetbrains.kotlin.konan.library.KonanLibrary
import org.jetbrains.kotlin.konan.library.defaultResolver
import org.jetbrains.kotlin.konan.library.libraryResolver
import org.jetbrains.kotlin.konan.properties.loadProperties
import org.jetbrains.kotlin.konan.target.*
import org.jetbrains.kotlin.konan.KonanAbiVersion
import org.jetbrains.kotlin.konan.KonanVersion
import org.jetbrains.kotlin.konan.library.resolver.TopologicalLibraryOrder
import org.jetbrains.kotlin.konan.library.toUnresolvedLibraries
import org.jetbrains.kotlin.konan.parseKonanVersion
import org.jetbrains.kotlin.konan.util.Logger
import kotlin.system.exitProcess

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.declarations.IrFunction
import org.jetbrains.kotlin.ir.util.SYNTHETIC_OFFSET
import org.jetbrains.kotlin.js.descriptorUtils.getJetTypeFqName
import org.jetbrains.kotlin.konan.CURRENT
import org.jetbrains.kotlin.konan.KonanVersion
import org.jetbrains.kotlin.konan.file.File
import org.jetbrains.kotlin.resolve.descriptorUtil.classId
Expand Down
2 changes: 1 addition & 1 deletion backend.native/debugger-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'kotlin'
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
compile project(path: ':backend.native', configuration: 'cli_bc')
compile kotlinNativeSharedModule
compile "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
compile 'junit:junit:4.12'
}

Expand Down
21 changes: 10 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ import org.jetbrains.kotlin.konan.*

buildscript {
apply from: "gradle/kotlinGradlePlugin.gradle"
apply from: "gradle/kotlinNativeShared.gradle"
dependencies {
classpath "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
}
}
import org.jetbrains.kotlin.konan.*

// Allows generating wrappers for the root build and all the samples during execution of the default 'wrapper' task.
// Run './gradlew wrapper --gradle-version <version>' to update all the wrappers.
Expand All @@ -49,14 +52,13 @@ ext {
kotlinTestAnnotationsCommonModule="org.jetbrains.kotlin:kotlin-test-annotations-common:${kotlinStdlibVersion}:sources"
kotlinReflectModule="org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}"
kotlinScriptRuntimeModule="org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}"
kotlinNativeSharedModule="org.jetbrains.kotlin:kotlin-native-shared:$sharedVersion"

konanVersionFull = KonanVersionGeneratedKt.getCurrentKonanVersion()
konanVersionFull = KonanVersion.Companion.CURRENT

if (konanVersionFull.meta == MetaVersion.RELEASE) {
gradlePluginVersion = kotlinVersion
} else {
gradlePluginVersion = "$kotlinVersion-native-${konanVersionFull.toString()}"
gradlePluginVersion = "$kotlinVersion-native-${KonanVersion.Companion.CURRENT.toString()}"
}
}

Expand All @@ -75,9 +77,6 @@ allprojects {
maven {
url kotlinCompilerRepo
}
maven {
url sharedRepo
}
}

setupHostAndTarget()
Expand Down Expand Up @@ -205,8 +204,8 @@ dependencies {
}
}

task versionJar {
dependsOn gradle.includedBuild('kotlin-native-version').task(':jar')
task sharedJar {
dependsOn gradle.includedBuild('kotlin-native-shared').task(':jar')
}

task gradlePluginJar {
Expand Down Expand Up @@ -263,7 +262,7 @@ task distCompiler(type: Copy) {
dependsOn ':backend.native:jar'
dependsOn ':utilities:jar'
dependsOn ':klib:jar'
dependsOn ':versionJar'
dependsOn ':sharedJar'

destinationDir distDir

Expand Down Expand Up @@ -323,7 +322,7 @@ task distCompiler(type: Copy) {
into('konan/lib')
}

from(file("${gradle.includedBuild('kotlin-native-version').projectDir}/build/libs")) {
from(file("${gradle.includedBuild('kotlin-native-shared').projectDir}/build/libs")) {
into('konan/lib')
}

Expand Down
3 changes: 0 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ buildscript {
apply(from = "$rootBuildDirectory/gradle/kotlinGradlePlugin.gradle")
}


val buildKotlinCompilerRepo: String by project
val sharedRepo: String by project

val repos = listOf(
buildKotlinCompilerRepo,
"https://cache-redirector.jetbrains.com/maven-central",
"https://kotlin.bintray.com/kotlinx",
sharedRepo
)

allprojects {
Expand Down
15 changes: 3 additions & 12 deletions buildSrc/plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,10 @@ dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
compile "org.jetbrains.kotlin:kotlin-reflect:$buildKotlinVersion"
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')
compile "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.10.0"

// Support composite build against kotlin-native-shared.
// Gradle cannot substitute a dependency in buildSrc by an included build.
// See: https://github.com/gradle/gradle/issues/3768.
// Thus we have to compile sources of the included shared once more to use it in buildSrc.
if (project.hasProperty("sharedProjectPath")) {
compile project(':shared')
} else {
// If there is no composite build against shared, add a dependency on a published jar.
compile "org.jetbrains.kotlin:kotlin-native-shared:$sharedVersion"
}

}

rootProject.dependencies {
Expand Down
16 changes: 1 addition & 15 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,5 @@
* limitations under the License.
*/

import java.util.*

include(":plugins")

// Read properties from the root gradle.properties to allow setting path to K/N shared there.
// We cannot store these properties here so we have to read them once more during configuration of projects.
val rootProperties = Properties().apply {
file("../gradle.properties").inputStream().use { load(it) }
}

// Property specified using a command line option.
val sharedProjectPath: String? by settings

if (sharedProjectPath != null || rootProperties.containsKey("sharedProjectPath")) {
include(":shared")
}
include(":shared")
44 changes: 44 additions & 0 deletions buildSrc/shared/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

buildscript {
ext {
gradleProperties = new Properties()
gradleProperties.load(new FileInputStream("$projectDir/../../gradle.properties"))
buildKotlinVersion = gradleProperties."buildKotlinVersion"
buildKotlinCompilerRepo = gradleProperties."buildKotlinCompilerRepo"
}

apply from: '../../gradle/kotlinGradlePlugin.gradle'
}

apply plugin: 'kotlin'

// We reuse the source code from the Project in buildSrc.
sourceSets.main.kotlin.srcDirs = ["$projectDir/../../shared/src/main/kotlin"]

repositories {
maven {
url buildKotlinCompilerRepo
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
}

rootProject.dependencies {
runtime project(path)
}
5 changes: 2 additions & 3 deletions cmd/run_konan
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,13 @@ KOTLIN_SCRIPT_RUNTIME_JAR="${KONAN_HOME}/konan/lib/kotlin-script-runtime.jar"
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"
SHARED_JAR="${KONAN_HOME}/konan/lib/kotlin-native-shared.jar"
SHARED_JAR="${KONAN_HOME}/konan/lib/shared.jar"
EXTRACTED_METADATA_JAR="${KONAN_HOME}/konan/lib/konan.metadata.jar"
EXTRACTED_SERIALIZER_JAR="${KONAN_HOME}/konan/lib/konan.serializer.jar"
KLIB_JAR="${KONAN_HOME}/konan/lib/klib.jar"
UTILITIES_JAR="${KONAN_HOME}/konan/lib/utilities.jar"
TROVE_JAR="${KONAN_HOME}/konan/lib/trove4j.jar"
VERSION_JAR="${KONAN_HOME}/konan/lib/version.jar"
KONAN_CLASSPATH="$KOTLIN_JAR:$KOTLIN_STDLIB_JAR:$KOTLIN_REFLECT_JAR:$KOTLIN_SCRIPT_RUNTIME_JAR:$INTEROP_JAR:$STUB_GENERATOR_JAR:$INTEROP_INDEXER_JAR:$KONAN_JAR:$KLIB_JAR:$UTILITIES_JAR:$SHARED_JAR:$EXTRACTED_METADATA_JAR:$EXTRACTED_SERIALIZER_JAR:$TROVE_JAR:$VERSION_JAR"
KONAN_CLASSPATH="$KOTLIN_JAR:$KOTLIN_STDLIB_JAR:$KOTLIN_REFLECT_JAR:$KOTLIN_SCRIPT_RUNTIME_JAR:$INTEROP_JAR:$STUB_GENERATOR_JAR:$INTEROP_INDEXER_JAR:$KONAN_JAR:$KLIB_JAR:$UTILITIES_JAR:$SHARED_JAR:$EXTRACTED_METADATA_JAR:$EXTRACTED_SERIALIZER_JAR:$TROVE_JAR"
TOOL_CLASS=org.jetbrains.kotlin.cli.utilities.MainKt

LIBCLANG_DISABLE_CRASH_RECOVERY=1 \
Expand Down
5 changes: 2 additions & 3 deletions cmd/run_konan.bat
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if not "!ARG!" == "" (
set "NATIVE_LIB=%_KONAN_HOME%\konan\nativelib"
set "KONAN_LIB=%_KONAN_HOME%\konan\lib"

set "SHARED_JAR=%KONAN_LIB%\kotlin-native-shared.jar"
set "SHARED_JAR=%KONAN_LIB%\shared.jar"
set "EXTRACTED_METADATA_JAR=%KONAN_LIB%\konan.metadata.jar"
set "EXTRACTED_SERIALIZER_JAR=%KONAN_LIB%\konan.serializer.jar"
set "INTEROP_INDEXER_JAR=%KONAN_LIB%\Indexer.jar"
Expand All @@ -68,9 +68,8 @@ set "KOTLIN_SCRIPT_RUNTIME_JAR=%KONAN_LIB%\kotlin-script-runtime.jar"
set "STUB_GENERATOR_JAR=%KONAN_LIB%\StubGenerator.jar"
set "UTILITIES_JAR=%KONAN_LIB%\utilities.jar"
set TROVE_JAR="%KONAN_LIB%\lib\trove4j.jar"
set "VERSION_JAR=%KONAN_LIB%\version.jar"

set "KONAN_CLASSPATH=%KOTLIN_JAR%;%KOTLIN_STDLIB_JAR%;%KOTLIN_REFLECT_JAR%;%KOTLIN_SCRIPT_RUNTIME_JAR%;%INTEROP_RUNTIME_JAR%;%KONAN_JAR%;%STUB_GENERATOR_JAR%;%INTEROP_INDEXER_JAR%;%SHARED_JAR%;%EXTRACTED_METADATA_JAR%;%EXTRACTED_SERIALIZER_JAR%;%KLIB_JAR%;%UTILITIES_JAR%;%TROVE_JAR%;%VERSION_JAR%"
set "KONAN_CLASSPATH=%KOTLIN_JAR%;%KOTLIN_STDLIB_JAR%;%KOTLIN_REFLECT_JAR%;%KOTLIN_SCRIPT_RUNTIME_JAR%;%INTEROP_RUNTIME_JAR%;%KONAN_JAR%;%STUB_GENERATOR_JAR%;%INTEROP_INDEXER_JAR%;%SHARED_JAR%;%EXTRACTED_METADATA_JAR%;%EXTRACTED_SERIALIZER_JAR%;%KLIB_JAR%;%UTILITIES_JAR%;%TROVE_JAR%"

set JAVA_OPTS=-ea ^
-Xmx3G ^
Expand Down
6 changes: 1 addition & 5 deletions extracted/konan.serializer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,11 @@ repositories {
maven {
url buildKotlinCompilerRepo
}
maven {
url sharedRepo
}
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
compile "org.jetbrains.kotlin:kotlin-native-shared:$sharedVersion"
compile "org.jetbrains.kotlin:kotlin-native-version"
compile "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
compile "org.jetbrains.kotlin:kotlin-compiler:$kotlinVersion"
compile "org.jetbrains.kotlin:konan.metadata:$konanVersion"
}
4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ kotlinVersion=1.3.50-dev-560
kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-560,branch:default:true,pinned:true/artifacts/content/maven
kotlinStdlibVersion=1.3.50-dev-560
testKotlinCompilerVersion=1.3.50-dev-560
# See https://teamcity.jetbrains.com/project.html?projectId=Kotlin_KotlinNativeShared&tab=projectOverview
sharedRepo=https://dl.bintray.com/jetbrains/kotlin-native-dependencies
sharedVersion=1.0-dev-99
konanVersion=1.3.50
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
org.gradle.workers.max=4
#kotlinProjectPath=/Users/jetbrains/IdeaProjects/kotlin
#sharedProjectPath=/Users/jetbrains/IdeaProjects/kotlin-native-shared
19 changes: 0 additions & 19 deletions gradle/kotlinNativeShared.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion libclangext/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ buildscript {
ext.rootBuildDirectory = file('..')

apply from: "$rootBuildDirectory/gradle/kotlinGradlePlugin.gradle"
apply from: "$rootBuildDirectory/gradle/kotlinNativeShared.gradle"

dependencies {
classpath "org.jetbrains.kotlin:kotlin-stdlib:$buildKotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-native-shared:$konanVersion"
}
}
import org.jetbrains.kotlin.konan.target.ClangArgs
Expand Down
Loading

0 comments on commit 5745b31

Please sign in to comment.