-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
87 lines (75 loc) · 1.94 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
// Import plugins
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}
// Apply plugins
apply plugin: 'java' // Support for Java
apply plugin: 'license' // Automatic license headers
apply plugin: 'eclipse' // Helper plugin for IDE
apply plugin: 'idea' // Helper plugin for IDE
// Extended project information.
ext.projectName = 'SimpleMail'
ext.packaging = 'jar'
ext.author = 'Felix Schmidt'
ext.authorUrl = 'https://github.com/boformer'
ext.inceptionYear = '2015'
// Set plugin version.
version = '0.1.0'
// Maven group
group = 'com.github.boformer'
// Set compatibility
sourceCompatibility = 1.7
targetCompatibility = 1.7
// Set Maven repositories to check for dependencies
repositories {
maven {
name 'Sponge maven repo'
url 'http://repo.spongepowered.org/maven'
}
mavenCentral()
}
// Add a new dependency configuration
configurations {
provided
compile.extendsFrom provided
}
// Add your own dependencies.
// You can also edit which version of the SpongeAPI is used by the plugin
dependencies {
provided 'org.spongepowered:spongeapi:4.0.3' // Assume availability of the Sponge API
}
// Configure license headers
license {
ext.name = rootProject.projectName
ext.author = rootProject.author
ext.url = rootProject.authorUrl
ext.year = rootProject.inceptionYear
exclude "**/*.info"
exclude "**/*.html"
exclude "assets/**"
header new File(rootProject.getProjectDir(), "HEADER.txt")
sourceSets = project.sourceSets
ignoreFailures false
strictCheck true
mapping {
java = 'SLASHSTAR_STYLE'
}
}
// Make the jar task contain all dependencies except for the provided configuration in the final output
jar {
dependsOn configurations.runtime
from {
(configurations.runtime - configurations.provided).collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
// Include LICENSE.txt in all jars
processResources {
from new File(rootProject.getProjectDir(), "LICENSE.txt")
}