Files
kotlin-fork/tools/gradle-plugin/build.gradle
T
Ilya Matveev 52bbbc1815 gradle-plugin: Specify compiler version in project properties
This patch allows gradle-plugin user to specify a compiler version
via project properties. The default version is 0.2. It also updates
samples to use this new version of gradle plugin.
2017-05-05 19:40:21 +07:00

100 lines
3.0 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: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
// 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()
}
configurations {
konanCompiler
}
evaluationDependsOn(':tools:helpers')
dependencies {
// TODO: do we need it?
konanCompiler project(':backend.native')
compile project(':tools:helpers')
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile gradleApi()
}
jar {
dependsOn(':tools:helpers:jar')
from (rootProject.findProject(':tools:helpers').sourceSets.main.output)
}
publishing {
publications {
gradlePlugin(MavenPublication) {
artifact jar
groupId 'org.jetbrains.kotlin'
artifactId 'kotlin-native-gradle-plugin'
version '0.2'
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 = '0.2'
desc = 'Kotlin Native Gradle plugin 0.2'
}
publish = true // project.hasProperty("publish")
override = project.hasProperty("override")
}
publications = ['gradlePlugin']
}