113 lines
3.4 KiB
Groovy
113 lines
3.4 KiB
Groovy
/**
|
|
* One may use bintrayUser/bintrayKey project properties or BINTRAY_USER/BINTRAY_KEY environment variables to upload
|
|
* built plugin to bintray repository.
|
|
*/
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
jcenter()
|
|
}
|
|
|
|
dependencies {
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
|
|
}
|
|
}
|
|
apply plugin: 'java'
|
|
apply plugin: 'kotlin'
|
|
apply plugin: 'groovy'
|
|
apply plugin: 'maven-publish'
|
|
apply plugin: 'com.jfrog.bintray'
|
|
apply plugin: 'java-gradle-plugin'
|
|
|
|
group = 'org.jetbrains.kotlin'
|
|
version = konanVersion
|
|
|
|
// TODO: move this code to top level (the same for backend.native)
|
|
// Copied from backend.native
|
|
allprojects {
|
|
repositories {
|
|
maven { url kotlinCompilerRepo }
|
|
}
|
|
|
|
configurations.all {
|
|
// kotlin-compiler module includes Kotlin runtime bundled;
|
|
// make Gradle aware of this to avoid multiple Kotlin runtimes in classpath:
|
|
resolutionStrategy.dependencySubstitution {
|
|
substitute module('org.jetbrains.kotlin:kotlin-runtime') with module(kotlinCompilerModule)
|
|
substitute module('org.jetbrains.kotlin:kotlin-stdlib') with module(kotlinCompilerModule)
|
|
substitute module('org.jetbrains.kotlin:kotlin-reflect') with module(kotlinCompilerModule)
|
|
}
|
|
// TODO: probably we should use kotlin-compiler without bundled runtime
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
evaluationDependsOn(':tools:helpers')
|
|
|
|
dependencies {
|
|
compile project(':shared')
|
|
compile project(':tools:helpers')
|
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
compile gradleApi()
|
|
|
|
testCompile gradleTestKit()
|
|
testCompile 'junit:junit:4.12'
|
|
testCompile('org.spockframework:spock-core:1.1-groovy-2.4') {
|
|
exclude module: 'groovy-all'
|
|
}
|
|
}
|
|
|
|
test {
|
|
dependsOn ':dist'
|
|
//testLogging.showStandardStreams = true
|
|
systemProperty("konan.home", rootProject.file('dist'))
|
|
}
|
|
|
|
jar {
|
|
dependsOn(':tools:helpers:jar')
|
|
from (rootProject.findProject(':tools:helpers').sourceSets.main.output)
|
|
from (rootProject.findProject(':shared').sourceSets.main.output)
|
|
}
|
|
|
|
processResources {
|
|
expand('konanVersion': konanVersion)
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
gradlePlugin(MavenPublication) {
|
|
artifact jar
|
|
pom.withXml { XmlProvider xml ->
|
|
def stdlibDep = xml.asNode().appendNode("dependencies").appendNode("dependency")
|
|
stdlibDep.appendNode("groupId", "org.jetbrains.kotlin")
|
|
stdlibDep.appendNode("artifactId", "kotlin-stdlib")
|
|
stdlibDep.appendNode("version", "$kotlin_version")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
bintray {
|
|
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
|
|
key = project.hasProperty('bintrayKey') ? project.property('bintrayKey') : System.getenv('BINTRAY_KEY')
|
|
pkg {
|
|
repo = 'kotlin-native-dependencies'
|
|
name = 'kotlin-native-gradle-plugin'
|
|
userOrg = 'jetbrains'
|
|
licenses = ['Apache-2.0']
|
|
vcsUrl = 'https://github.com/JetBrains/kotlin-native'
|
|
version {
|
|
name = konanVersion
|
|
desc = "Kotlin Native Gradle plugin $konanVersion"
|
|
}
|
|
publish = true // project.hasProperty("publish")
|
|
override = project.hasProperty("override")
|
|
}
|
|
publications = ['gradlePlugin']
|
|
}
|