-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
130 lines (110 loc) · 3.61 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
uploadArchives {
repositories.mavenDeployer {
repository(url: "file:///Users/bouchard/Documents/web/public_html/maven/")
pom.version = "1.0.2"
pom.artifactId = "simplesmc"
pom.groupId = "ca.ubc.stat"
}
}
eclipse {
classpath {
defaultOutputDir = file('bin')
}
}
repositories {
mavenCentral()
jcenter()
maven {
url "file:///Users/bouchard/Documents/web/public_html/maven/"
}
maven {
url "http://www.stat.ubc.ca/~bouchard/maven/"
}
}
dependencies {
compile group: 'com.google.guava', name: 'guava', version: '18.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'junit', name: 'junit', version: '4.12'
compile group: 'ca.ubc.stat', name: 'tutorialj', version: '2.0.4'
compile group: 'ca.ubc.stat', name: 'binc', version: '1.2.1'
compile group: 'ca.ubc.stat', name: 'briefj', version: '2.4.9'
compile group: 'ca.ubc.stat', name: 'bayonet', version: '2.3.17'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
compile 'com.google.code.gson:gson:2.3.1'
}
task(tutorialj, dependsOn: ['build','testClasses'], type: JavaExec) {
main = 'tutorialj.Main'
classpath {
configurations.compile
sourceSets.main.runtimeClasspath
sourceSets.test.runtimeClasspath
}
}
apply plugin: 'versions'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
buildscript {
repositories {
maven { url "https://github.com/ben-manes/gradle-versions-plugin/raw/mvnrepo" }
mavenCentral()
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.5-beta-1'
}
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
//noinspection SpellCheckingInspection
tasks.withType(Javadoc) {
// disable the crazy super-strict doclint tool in Java 8
//noinspection SpellCheckingInspection
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
// http://www.gradle.org/docs/current/userguide/application_plugin.html
// use 'gradle startScripts' to create script
// use 'gradle distZip' to create deployable zip
// use 'gradle installApp' to copy it somewhere
apply plugin:'application'
// Creates scripts for entry points
// Subproject must apply application plugin to be able to call this method.
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
}
}
}
// The next two lines disable the tasks for the primary main which by default
// generates a script with a name matching the project name.
// You can leave them enabled but if so you'll need to define mainClassName
// And you'll be creating your application scripts two different ways which
// could lead to confusion
startScripts.enabled = false
run.enabled = false
// Call this for each Main class you want to expose with an app script
createScript(project, 'simplesmc.Main', 'main')
//createScript(project, 'simplesmc.AnotherMain', 'another-main')