-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
54 lines (47 loc) · 1.36 KB
/
build.gradle
File metadata and controls
54 lines (47 loc) · 1.36 KB
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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.9.2'
}
}
plugins {
id 'groovy'
id 'java'
}
apply plugin: 'org.asciidoctor.convert'
group 'com.telecwin'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
maven {
url "http://maven.aliyun.com/nexus/content/groups/public/"
}
mavenCentral()
}
dependencies {
implementation 'org.codehaus.groovy:groovy-all:2.3.11'
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
asciidoctor {
sourceDir = file('docs')
}
// 下面的配置会让gradle先编译groovy,后编译java,以便在 java 中使用 groovy 类
// ref: https://coderwall.com/p/wuqopq/compile-groovy-before-java-in-gradle-build
// 因为 groovy 插件默认会先编译 java 后编译 groovy,导致 java 找不到 groovy 的类。
sourceSets {
main {
groovy {
// this makes the groovy-compiler compile groovy- as well
// as java-files.
// Needed, because java is normally compiled before groovy.
// Since we are using groovy objects from java, we need it
// the other way round.
srcDirs = ['src/main/groovy', 'src/main/java']
}
java {
srcDirs = [] // don't compile Java code twice
}
}
}