Introduced testLibrary and a test utilizing it.

This commit is contained in:
Alexander Gorshenev
2017-10-19 20:24:31 +03:00
committed by alexander-gorshenev
parent 7ade68452e
commit e2e883ee08
3 changed files with 38 additions and 0 deletions
+28
View File
@@ -24,3 +24,31 @@ dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile project(path: ':backend.native', configuration: 'cli_bc')
}
def dist = rootProject.file('dist').absolutePath
// TODO: Ideally we want to write just konanArtifacts{} clouse here,
// but we need to make Kotlin Native Gradle Plugin a dependence
// of our buildScripts first.
task compileKonanTestLibrary(type: Exec) {
dependsOn ':dist'
def compiler = "$dist/bin/konanc"
def source = 'src/testLibrary'
def artifact = 'build/konan/bin/testLibrary'
executable compiler
args source, '-o', artifact, '-p', 'library'
}
task installTestLibrary(type: Exec) {
dependsOn 'compileKonanTestLibrary'
def repo = "$dist/klib/common"
def tool = "$dist/bin/klib"
def library = 'build/konan/bin/testLibrary.klib'
executable tool
args 'install', library, '-repository', repo
}