forked from angular/clutz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
101 lines (82 loc) · 2.66 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
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.8'
// enforces java style
id 'net.ltgt.errorprone' version '0.6'
}
eclipse {
classpath {
downloadSources=true
}
}
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
}
// clutz runs against closure head inside google, so default to that, but also test against
// the latest release for external users
if (System.getenv().get('CI_MODE') == 'Released') {
compile 'com.google.javascript:closure-compiler:v20181008'
} else {
compile 'com.google.javascript:closure-compiler:1.0-SNAPSHOT'
}
compile 'com.google.code.gson:gson:2.7'
compile 'com.google.code.findbugs:jsr305:3.0.1'
compile 'com.google.guava:guava:20.0'
compile 'org.apache.commons:commons-text:1.4'
// ErrorProne itself, plus its javac integration.
errorprone("com.google.errorprone:error_prone_core:2.3.2")
errorproneJavac('com.google.errorprone:javac:9+181-r4173-1')
testCompile 'junit:junit:4.11'
testCompile 'com.google.truth:truth:0.40'
}
tasks.withType(Test) {
systemProperty 'gents.clangFormat',
System.getProperty('gents.clangFormat', 'node_modules/.bin/clang-format')
}
test {
testLogging {
exceptionFormat = 'full'
}
}
googleJavaFormat {
toolVersion '1.3'
}