forked from angular/clutz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
88 lines (71 loc) · 2.24 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
plugins {
id 'java'
id 'eclipse'
// Generate coverage during tests.
id 'jacoco'
// Generate executable scripts
id 'application'
// enforces consistent formatting
id 'com.github.sherter.google-java-format' version '0.6'
// enforces java style
id 'net.ltgt.errorprone' version '0.0.11'
}
def createScript(project, mainClass, name) {
project.tasks.create(name: name, type: CreateStartScripts) {
outputDir = new File(project.buildDir, 'scripts')
mainClassName = mainClass
applicationName = name
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtime
}
project.tasks[name].dependsOn(project.jar)
project.applicationDistribution.with {
into("bin") {
from(project.tasks[name])
fileMode = 0755
}
}
}
startScripts.enabled = false
run.enabled = false
sourceCompatibility = 1.8
version = '1.0'
createScript(project, 'com.google.javascript.clutz.DeclarationGenerator', 'clutz')
createScript(project, 'com.google.javascript.gents.TypeScriptGenerator', 'gents')
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
// Verify all versions match closure-compiler's deps to avoid version conflicts.
// Also make sure this matches internal Google usage, as closure-compiler is not always
// dilligent about using the correct versions.
// https://github.com/google/closure-compiler/blob/master/pom-main.xml
compile('args4j:args4j:2.0.26') {
// Forced, as Closure Compiler depends on the wrong version.
force = true
}
compile 'com.google.code.gson:gson:2.7'
if (System.getenv().get('CI_MODE') == 'Nightly') {
compile 'com.google.javascript:closure-compiler:1.0-SNAPSHOT'
} else {
compile 'com.google.javascript:closure-compiler:v20171023'
}
compile 'com.google.code.findbugs:jsr305:3.0.1'
compile 'com.google.guava:guava:20.0'
testCompile 'junit:junit:4.11'
testCompile 'com.google.truth:truth:0.30'
}
tasks.withType(Test) {
systemProperty 'gents.clangFormat',
System.getProperty('gents.clangFormat', 'node_modules/.bin/clang-format')
}
test {
testLogging {
exceptionFormat = 'full'
}
}
googleJavaFormat {
toolVersion '1.3'
}