forked from RPTools/parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
executable file
·124 lines (100 loc) · 3.03 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
buildscript {
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.26.1"
classpath "org.ajoberstar.grgit:grgit-gradle:4.0.1"
classpath 'antlr:antlr:2.7.7'
}
repositories {
mavenCentral()
}
}
// Access Git info from build script
plugins {
id "org.ajoberstar.grgit" version "4.0.1"
id 'antlr'
}
apply plugin: 'java-library'
apply plugin: 'com.diffplug.gradle.spotless'
apply plugin: 'maven'
project.sourceCompatibility = 10
project.targetCompatibility = 10
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
mavenLocal()
maven { url = 'http://maptool.craigs-stuff.net/repo/' }
}
dependencies {
implementation 'rhino:js:1.6R5'
implementation 'antlr:antlr:2.7.7'
testImplementation group: 'junit', name: 'junit', version: '4.11'
antlr 'antlr:antlr:2.7.7'
}
// Custom properties
ext {
// Get tag and commit info from Git to use for version numbering
def repo = grgit.open(currentDir: file('.'))
def head = repo.head()
def tags = repo.tag.list().find {
it.commit == head
}
if (tags) {
tagVersion = tags.getName()
project.version = tagVersion
}
revision = head.abbreviatedId
revisionFull = head.id
// println 'Configuring for ' + project.name + " " + tagVersion + " by " + vendor
}
group = "net.rptools.parser"
spotless {
java {
target project.fileTree(project.rootDir) {
include 'src/**/*.java'
exclude '**/generated-src/'
}
licenseHeaderFile 'spotless.license.java'
// Now using the Google Java style guide
//eclipse().configFile('build-resources/eclipse.prefs.formatter.xml')
googleJavaFormat()
// If you get exceptions thrown by spotlessApply, this might
// help. Enable it here if the problem is with a Java file, and
// below if it is not. Don't leave it enabled, as nothing will
// actually be updated if you do.
// https://github.com/diffplug/spotless/blob/master/PADDEDCELL.md
//paddedCell()
}
format 'misc', {
target '**/*.gradle', '**/.gitignore'
// spotless has built-in rules for most basic formatting tasks
trimTrailingWhitespace()
// or spaces. Takes an integer argument if you don't like 4
indentWithSpaces(4)
//paddedCell()
}
}
configurations {
deployerJars
}
install {
repositories.mavenInstaller {
pom.version = project.version
pom.artifactId = 'parser'
pom.groupId = 'net.rptools.parser'
}
}
uploadArchives {
repositories.mavenDeployer {
pom.version = project.version
pom.artifactId = 'parser'
pom.groupId = 'net.rptools.parser'
configuration = configurations.deployerJars
repository url: 'file://' + projectDir + '/../maven-repo'
}
}
jar {
manifest {
attributes 'Implementation-Title': 'parser',
'Implementation-Version': project.version
}
}