forked from RPTools/dicelib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·136 lines (101 loc) · 2.64 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
import org.apache.tools.ant.filters.ReplaceTokens
import java.text.SimpleDateFormat
import org.ajoberstar.grgit.*
apply plugin: 'java'
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'application'
apply plugin: 'maven'
apply plugin: 'com.diffplug.gradle.spotless'
sourceCompatibility = 1.7
targetCompatibility = 1.7
if (version == 'unspecified') {
version = getVersionName()
}
ext.repo = Grgit.open(project.file('.'))
spotless {
java {
eclipseFormatFile 'build-resources/eclipse.prefs.formatter.xml'
}
}
configurations {
deployerJars
}
task wrapper(type: Wrapper) {
gradleVersion='2.1'
}
install {
repositories.mavenInstaller {
pom.version = project.version;
pom.artifactId = 'dicelib';
pom.groupId = 'net.rptools.dicelib';
}
}
uploadArchives {
repositories.mavenDeployer {
pom.version = project.version;
pom.artifactId = 'dicelib';
pom.groupId = 'net.rptools.dicelib';
configuration = configurations.deployerJars;
repository url: 'file://' + projectDir + '/../maven-repo'
}
}
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'org.ajoberstar:gradle-git:0.11.2'
classpath 'com.diffplug.gradle.spotless:spotless:1.3.0-SNAPSHOT'
}
}
dependencies {
compile 'rhino:js:1.6R5'
compile 'antlr:antlr:2.7.6'
compile 'net.rptools.parser:parser:1.1.b24'
testCompile group: 'junit', name: 'junit', version: '4.11'
deployerJars 'org.apache.maven.wagon:wagon-ssh:2.2'
}
ext.compileDate = new Date();
ext.yyyymmdd = (new SimpleDateFormat('yyyyMMDD')).format(ext.compileDate);
repositories {
mavenCentral()
mavenLocal()
maven {
url = 'http://maptool.craigs-stuff.net/repo/'
}
}
/*
* Gets the version name from the latest Git tag
*/
def getVersionName() {
if (project.hasProperty('buildVersion')) {
return buildVersion
} else {
String vtxtVersionNo = new File('build-resources/version.txt').text.trim()
return vtxtVersionNo
}
}
findbugs {
ignoreFailures = true
toolVersion = '3.0.0'
effort = 'max'
sourceSets = [] // Empty source set so it wont run during build/check
}
pmd {
ignoreFailures = true
sourceSets = [] // Empty source set so it wont run during tebuild/check
}
task showBuildVersion() << {
println 'Build Version Number = ' + project.version
}
jar {
manifest {
attributes 'Implementation-Title': 'dicelib',
'Implementation-Version': project.version
}
}