forked from SpongePowered/SpongeAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
97 lines (80 loc) · 2.38 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
// Default tasks
defaultTasks 'licenseFormat', 'build', 'install'
// Apply plugin
apply plugin: 'java'
apply plugin: 'license'
apply plugin: 'maven'
apply plugin: 'signing'
// Basic project information
group = 'org.spongepowered'
archivesBaseName = 'spongeapi'
version = '1.0.0-SNAPSHOT'
// Extended project information
ext.projectName = 'SpongeAPI'
ext.inceptionYear = '2014'
ext.packaging = 'jar'
ext.url = 'http://spongepowered.org'
ext.description = 'SpongeAPI'
ext.organization = 'SpongePowered'
// Define variables
ext.buildNumber = project.hasProperty("buildNumber") ? buildNumber : '0'
ext.ciSystem = project.hasProperty("ciSystem") ? ciSystem : 'unknown'
ext.commit = project.hasProperty("commit") ? commit : 'unknown'
// Minimum version of Java required
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
// Configuration settings
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' // Always check for new snapshots
}
// Gradle repositories and dependencies
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}
// Project repositories
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'sonatype-nexus-public'
url = 'https://oss.sonatype.org/content/repositories/public/'
}
}
// Project dependencies
dependencies {
compile 'org.apache.logging.log4j:log4j-api:2.0.2'
}
// Filter, process, and include resources
processResources {
// Include in final JAR
from(rootProject.rootDir) {
include 'LICENSE.txt'
}
}
license {
ext.name = project.name
ext.organization = organization
ext.url = url
ext.year = inceptionYear
header rootProject.file('HEADER.txt')
ignoreFailures true
strictCheck true
}
// Source compiler configuration
configure([compileJava, compileTestJava]) {
options.compilerArgs << '-Xlint:all'
options.compilerArgs << '-Xlint:-path'
options.deprecation = true
}
// JAR manifest configuration
jar.manifest.mainAttributes(
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
"Implementation-Title": name,
"Implementation-Version": version + "+" + ciSystem + "-b" + buildNumber + ".git-" + commit,
"Implementation-Vendor": url)