-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathbuild.gradle
71 lines (57 loc) · 1.75 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
import com.uber.nanoscope.release.IncrementType
import com.uber.nanoscope.release.Nanoscope
buildscript {
ext.kotlin_version = '1.2.41'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'java'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'application'
mainClassName = "com.uber.nanoscope.MainKt"
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "com.squareup.moshi:moshi-kotlin:1.5.0"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
task('deployRelease', dependsOn: distZip) {
doLast {
if (!project.hasProperty("increment")) {
throw new InvalidUserDataException("Must supply an increment type: -Pincrement=[major|minor|patch]")
}
try {
def incrementType = IncrementType.valueOf(project.increment.toUpperCase())
Nanoscope.release(project.tasks.distZip.archivePath, incrementType)
} catch (IllegalArgumentException ignore) {
throw new InvalidUserDataException("Invalid increment type: ${project.increment}. Must be one of [major|minor|patch].")
}
}
}
task('deleteReleaseDrafts') {
doLast {
Nanoscope.deleteReleaseDrafts()
}
}
applicationDistribution.from("wrapper/nanoscopew") {
into("bin")
fileMode = 0755
}
[installDist, distZip].forEach { task ->
task.rename("^nanoscope\$", "_nanoscope")
task.rename("^nanoscopew\$", "nanoscope")
}
applicationDefaultJvmArgs = ["-Xmx8g"]