Move everything under kotlin-native folder

I was forced to manually do update the following files, because otherwise
they would be ignored according .gitignore settings. Probably they
should be deleted from repo.

Interop/.idea/compiler.xml
Interop/.idea/gradle.xml
Interop/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_3.xml
Interop/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_3.xml
Interop/.idea/modules.xml
Interop/.idea/modules/Indexer/Indexer.iml
Interop/.idea/modules/Runtime/Runtime.iml
Interop/.idea/modules/StubGenerator/StubGenerator.iml
backend.native/backend.native.iml
backend.native/bc.frontend/bc.frontend.iml
backend.native/cli.bc/cli.bc.iml
backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt
backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt
backend.native/tests/link/lib/foo.kt
backend.native/tests/link/lib/foo2.kt
backend.native/tests/teamcity-test.property
This commit is contained in:
Stanislav Erokhin
2020-10-27 21:00:28 +03:00
parent 91e4162dad
commit f624800b84
2830 changed files with 0 additions and 0 deletions
+115
View File
@@ -0,0 +1,115 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
import groovy.transform.stc.ClosureParams
import groovy.transform.stc.FromString
import org.jetbrains.kotlin.konan.target.*
import static org.jetbrains.kotlin.konan.target.KonanTarget.*
import org.jetbrains.kotlin.konan.util.Named
import org.jetbrains.kotlin.konan.properties.KonanPropertiesLoader
import org.jetbrains.kotlin.konan.util.ArchiveType
import org.jetbrains.kotlin.konan.util.DependencyProcessor
import static org.jetbrains.kotlin.konan.util.VisibleNamedKt.getVisibleName
buildscript {
apply from: "$rootDir/gradle/kotlinGradlePlugin.gradle"
repositories {
maven {
url = 'https://cache-redirector.jetbrains.com/jcenter'
}
}
}
/**
* Downloads dependencies from the given URL into the given directory.
* The set of dependencies is determined by konanPropertiesLoader.
*/
class NativeDep extends DefaultTask {
static final String baseUrl = "https://cache-redirector.jetbrains.com/download.jetbrains.com/kotlin/native"
KonanPropertiesLoader konanPropertiesLoader = null
final File getBaseOutDir() {
final File res = project.rootProject.ext.dependenciesDir
res.mkdirs()
return res
}
@TaskAction
void downloadAndExtract() {
def downloader = new DependencyProcessor(baseOutDir, konanPropertiesLoader, baseUrl, false, ArchiveType.systemDefault)
downloader.showInfo = false
downloader.run()
}
}
enum DependencyKind {
LLVM( "llvm", { it.llvmHome }, { "llvmDir" } ),
LIBFFI( "libffi", { it.libffiDir } )
DependencyKind(String name,
@ClosureParams(value = FromString.class, options = "KonanPropertiesLoader") Closure<String> dirGetter,
@ClosureParams(value = FromString.class, options = "KonanTarget") Closure<String> propertyNameGetter =
{target -> "${target.visibleName}${name.capitalize()}Dir"}) {
this.name = name
this.dirGetter = dirGetter
this.propertyNameGetter = propertyNameGetter
}
private String name
private Closure<String> dirGetter // KonanProperties -> String
private Closure<String> propertyNameGetter // KonanTarget -> String
String getDirectory(KonanPropertiesLoader properties) {
return dirGetter(properties)
}
String getPropertyName(KonanTarget target) {
return propertyNameGetter(target)
}
String toString() { return name }
}
def platformManager = rootProject.ext.platformManager
platformManager.filteredOutEnabledButNotSupported.each { target ->
def loader = platformManager.loader(target)
task "${target}Dependencies"(type: NativeDep) {
konanPropertiesLoader = loader
}
// Also resolves all dependencies:
final DependencyProcessor dependencyProcessor = new DependencyProcessor(
project.rootProject.ext.dependenciesDir,
loader.properties,
loader.dependencies,
NativeDep.baseUrl,
false,
ArchiveType.systemDefault
)
DependencyKind.values().each { kind ->
def dir = kind.getDirectory(loader)
if (dir != null) {
String path = dependencyProcessor.resolve(dir).canonicalPath
rootProject.ext.set(kind.getPropertyName(target), path)
}
}
}
task update(type: Copy) {
dependsOn tasks.withType(NativeDep)
}
task rmDotKonan(type: Delete) {
def dir = System.getenv("KONAN_DATA_DIR") ?: "${System.getProperty("user.home")}/.konan"
delete dir
}