Skip to content

Commit

Permalink
gradle-plugin: Upload to bintray maven repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmat192 committed Mar 31, 2017
1 parent 0b3d3cb commit f51b61a
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ kotstd/kotstd.iml
*.kt.exe
*.log
test.output
*.kexe

# Ignore Gradle GUI config
gradle-app.setting
Expand Down
8 changes: 4 additions & 4 deletions samples/csvparser/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
buildscript {
ext.kotlin_version = '1.1.1'
repositories {
mavenCentral()
maven {
url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies"
}
}

dependencies {
classpath files('../gradle-plugin.jar')
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:0.1"
}
}

Expand All @@ -25,7 +26,6 @@ konanArtifacts {
}
}


build {
doLast {
copy {
Expand Down
11 changes: 6 additions & 5 deletions samples/gitchurn/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
buildscript {
ext.kotlin_version = '1.1.1'
repositories {
mavenCentral()
maven {
url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies"
}
}

dependencies {
classpath files('../gradle-plugin.jar')
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:0.1"
}
}

Expand All @@ -21,7 +22,7 @@ konanInterop {
}

konanArtifacts {
gitchurn {
GitChurn {
inputFiles project.fileTree('src')
useInterop 'libgit2'
linkerOpts "-L/opt/local/lib -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -lgit2"
Expand All @@ -32,7 +33,7 @@ konanArtifacts {
build {
doLast {
copy {
from compileKonanGitchurn.artifactPath
from compileKonanGitChurn.artifactPath
into projectDir.canonicalPath
}
}
Expand Down
Binary file removed samples/gradle-plugin.jar
Binary file not shown.
9 changes: 5 additions & 4 deletions samples/libcurl/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
buildscript {
ext.kotlin_version = '1.1.1'
repositories {
mavenCentral()
maven {
url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies"
}
}

dependencies {
classpath files('../gradle-plugin.jar')
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:0.1"
}
}

Expand All @@ -15,7 +16,7 @@ apply plugin: 'konan'
konanInterop {
libcurl {
defFile 'libcurl.def'
includeDirs '/usr/include', '/opt/local/include', '/usr/local/opt/curl/include'
includeDirs '/usr/include', '/opt/local/include', '/usr/local/opt/curl/include', '.'
}
}

Expand Down
9 changes: 5 additions & 4 deletions samples/opengl/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
buildscript {
ext.kotlin_version = '1.1.1'
repositories {
mavenCentral()
maven {
url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies"
}
}

dependencies {
classpath files('../gradle-plugin.jar')
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:0.1"
}
}

Expand All @@ -20,7 +21,7 @@ konanInterop {


konanArtifacts {
openGlTeapot {
OpenGlTeapot {
inputFiles project.file("OpenGlTeapot.kt")
useInterop 'opengl'
def osName = System.getProperty("os.name")
Expand Down
9 changes: 5 additions & 4 deletions samples/socket/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
buildscript {
ext.kotlin_version = '1.1.1'
repositories {
mavenCentral()
maven {
url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies"
}
}

dependencies {
classpath files('../gradle-plugin.jar')
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:0.1"
}
}

Expand All @@ -19,7 +20,7 @@ konanInterop {
}

konanArtifacts {
echoServer {
EchoServer {
inputFiles project.file("EchoServer.kt")
useInterop "sockets"
}
Expand Down
31 changes: 18 additions & 13 deletions samples/tetris/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
/**
* Use `./gradlew build<target platform>` to build the project.
* e.g. ./gradlew buildMacbook
*/

buildscript {
ext.kotlin_version = '1.1.1'
repositories {
mavenCentral()
maven {
url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies"
}
}

dependencies {
classpath files('../gradle-plugin.jar')
classpath "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:0.1"
}
}

Expand Down Expand Up @@ -41,23 +47,23 @@ konanInterop {
}

konanArtifacts {
tetrisMacbook {
TetrisMacbook {
inputFiles project.file('Tetris.kt')
useInterop 'sdlMacbook'
//linkerOpts "-F /Library/Frameworks -framework SDL2 -L/opt/local/lib -lSDL2"
linkerOpts "-L/usr/local/lib -lSDL2"
target 'macbook'
}

tetrisLinux {
TetrisLinux {
inputFiles project.file('Tetris.kt')
useInterop 'sdlLinux'

linkerOpts '-L/usr/lib/x86_64-linux-gnu -lSDL2'
target 'linux'
}

tetrisIphone {
TetrisIphone {

inputFiles project.file('Tetris.kt')
useInterop 'sdlIphone'
Expand All @@ -69,7 +75,7 @@ konanArtifacts {
target 'iphone'
}

tetrisRaspberry {
TetrisRaspberry {
inputFiles project.file('Tetris.kt')
useInterop 'sdlRaspberry'

Expand All @@ -79,11 +85,10 @@ konanArtifacts {

}

tasks.matching { it.name.startsWith("compileKonan") }.forEach { task ->
task.doLast {
copy {
from task.artifactPath
into projectDir.canonicalPath
}
tasks.matching { it.name.startsWith("compileKonan") }.asList().forEach { compileTask ->
task ("build${compileTask.name - "compileKonanTetris"}", type: Copy) {
dependsOn(compileTask)
from compileTask.artifactPath
destinationDir projectDir
}
}
57 changes: 43 additions & 14 deletions tools/gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
/**
* 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: '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
Expand Down Expand Up @@ -55,20 +64,40 @@ jar {
from (rootProject.findProject(':tools:helpers').sourceSets.main.output)
}

task dist(type: Copy) {
dependsOn(jar)
destinationDir project.file('dist')
from jar.outputs.files
publishing {
publications {
gradlePlugin(MavenPublication) {
artifact jar
groupId 'org.jetbrains.kotlin'
artifactId 'kotlin-native-gradle-plugin'
version '0.1'
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")
}
}
}
}

task copy_to_samples(type: Copy) {
dependsOn(dist)
destinationDir rootProject.file('samples')
from dist.outputs.files
}

clean {
doFirst {
delete project.file('dist')
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'
// TODO: Specify license and github path
//licenses = ['Apache-2.0']
//vcsUrl = 'https://github.com/...'
version {
name = '0.1'
desc = 'Kotlin Native Gradle plugin 0.1'
}
publish = true
override = true
}
publications = ['gradlePlugin']
}

0 comments on commit f51b61a

Please sign in to comment.