55 lines
1.6 KiB
Groovy
55 lines
1.6 KiB
Groovy
/*
|
|
* 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 {
|
|
apply from: "$rootDir/gradle/kotlinGradlePlugin.gradle"
|
|
}
|
|
|
|
apply plugin: 'kotlin'
|
|
|
|
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{} clause 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
|
|
}
|
|
|