forked from eugenkiss/kotlinfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
153 lines (123 loc) · 3.93 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
buildscript {
repositories {
mavenCentral()
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
allprojects {
repositories {
mavenCentral()
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
}
}
apply plugin: "kotlin"
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
compile 'org.reflections:reflections:0.9.9-RC1'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
subprojects {
buildscript {
repositories {
mavenCentral()
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
apply plugin: 'kotlin'
repositories {
mavenCentral()
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
}
}
// Code generation
task(genkalium, dependsOn: jar, type: JavaExec) {
main = 'genkalium.GenkaliumPackage'
classpath = sourceSets.main.runtimeClasspath
}
task(genproperties, dependsOn: jar, type: JavaExec) {
main = 'genproperties.GenpropertiesPackage'
classpath = sourceSets.main.runtimeClasspath
}
task(genpropabbrs, dependsOn: jar, type: JavaExec) {
main = 'genpropabbrs.GenpropabbrsPackage'
classpath = sourceSets.main.runtimeClasspath
}
task wrapper(type: Wrapper) {
gradleVersion = 1.11
doLast() {
def gradleOpts = "-Xmx1024m"
def gradlew_sh = file("gradlew")
def gradlew_bat = file("gradlew.bat")
gradlew_sh.text = gradlew_sh.text.replace("DEFAULT_JVM_OPTS=",
"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
gradlew_bat.text = gradlew_bat.text.replace("set DEFAULT_JVM_OPTS=",
"set GRADLE_OPTS=$gradleOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
}
}
// Distribution
// More information about the following code can be found in the wiki.
// TODO: I bet this could be simplified so much...
task distJar(type: Jar) {
archiveName = "kotlinfx-${rootProject.version}.jar"
from project(':kotlinfx-core').sourceSets.main.output.classesDir
}
// It is assumed that the KotlinFX-pages dir that is a clone of the gh-pages branch
// is a sibling of the KotlinFX project dir.
def ghpagesPath = "${projectDir.getParentFile()}/KotlinFX-pages"
def localRepoPath = ghpagesPath+"/repository"
project(":kotlinfx-core") {
apply plugin: 'maven'
group = rootProject.group
version = rootProject.version
archivesBaseName = 'kotlinfx'
uploadArchives {
repositories.mavenDeployer {
repository(url: "file:///" + localRepoPath)
pom.version = "${rootProject.version}"
pom.artifactId = 'kotlinfx'
pom.groupId = "${rootProject.group}"
}
}
// I just want to do it like this >:(!
//task publishgh {
// workingDir ghpagesPath
// uploadArchives
// commandLine './update-directory-index.sh'
// commandLine 'git add . && git commit --amend -m "Upload binaries" && git push -f'
//}
task updateIndex(type:Exec, dependsOn: uploadArchives) {
workingDir ghpagesPath
commandLine './update-directory-index.sh'
}
task publishgh0(type:Exec, dependsOn: updateIndex) {
workingDir ghpagesPath
commandLine 'git', 'add', '--all'
}
task publishgh1(type:Exec, dependsOn: publishgh0) {
workingDir ghpagesPath
commandLine 'git', 'commit', '--amend', '-m', '"Upload binaries"'
}
task publishgh(type:Exec, dependsOn: publishgh1) {
workingDir ghpagesPath
commandLine 'git', 'push', '-f'
}
}