-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
136 lines (119 loc) · 3.42 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
group 'com.shenjvm'
version '0.2.5'
project.ext {
baseName = 'shen-jvm'
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.1"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.jfrog.bintray'
sourceCompatibility = 1.6
task wrapper(type: Wrapper) {
gradleVersion = '4.3'
}
repositories {
jcenter()
}
dependencies {
compile group: 'org.ow2.asm', name: 'asm', version: '5.2'
compile group: 'org.ow2.asm', name: 'asm-commons', version: '5.2'
compile group: 'org.ow2.asm', name: 'asm-util', version: '5.2'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
compile group: 'commons-io', name: 'commons-io', version: '2.5'
}
task sourcesJar(type: Jar, dependsOn: classes) {
baseName = project.baseName
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
baseName = project.baseName
classifier = 'javadoc'
from javadoc.destinationDir
}
task runKLMain(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
main = "com.shenjvm.KLMain"
}
task compileAndRunKLMain(type: JavaExec, dependsOn: 'compileJava') {
classpath sourceSets.main.runtimeClasspath
main = "com.shenjvm.KLMain"
}
task uberJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar, dependsOn: ['runKLMain']) {
baseName = project.baseName
classifier = null
version = project.version
from sourceSets.main.output
configurations = [project.configurations.runtime]
manifest {
attributes 'Main-Class': 'shen.main'
}
}
task devUberJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar, dependsOn: ['runKLMain']) {
baseName = project.baseName
classifier = null
version = null
from sourceSets.main.output
configurations = [project.configurations.runtime]
manifest {
attributes 'Main-Class': 'shen.main'
}
}
task runDevUberJar(type: JavaExec) {
classpath = files('build/libs/shen-jvm.jar')
classpath += sourceSets.main.runtimeClasspath
main = "shen.main"
jvmArgs = ['-Xms200m', '-Xmx2g', '-Xss4m']
standardInput = System.in
}
shadowJar {
dependsOn 'runKLMain'
baseName = project.baseName
classifier = null
version = project.version
from sourceSets.main.output
configurations = [project.configurations.runtime]
manifest {
attributes 'Main-Class': 'shen.main'
}
}
publishing {
publications {
BintrayPublication(MavenPublication) { publication ->
project.shadow.component(publication)
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId project.baseName
version project.version
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
publications = ['BintrayPublication']
//dryRun = true
pkg {
repo = 'maven'
name = 'shen-jvm'
licenses = ['BSD', 'MIT']
vcsUrl = 'https://github.com/otabat/shen-jvm.git'
version {
name = project.version
released = new Date()
}
}
}