-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
86 lines (71 loc) · 1.98 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
buildscript {
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.12.1'
}
}
group 'io.github.mrblobman'
version '2.1.1'
apply plugin: 'maven-publish'
allprojects {
apply plugin: 'java'
apply plugin: 'com.github.hierynomus.license' //Ensure all files have the license header
license {
include '**/*.java'
header = rootProject.file('LICENSE')
strictCheck true
}
assemble.dependsOn licenseFormat
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
repositories {
mavenLocal()
//Spigot
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
mavenCentral()
}
}
//Make sure that all of the nms sub projects depend on the core
subprojects.each { subproject ->
if (subproject.name != 'core') {
subproject.dependencies {
compile project(':core')
}
}
}
jar {
subprojects.each { subproject ->
from subproject.sourceSets.main.output
}
}
task apiJar(type: Jar, dependsOn: [':core:classes', ':core:javadoc']) {
baseName = "${rootProject.name}-api"
//Add the sources, compilation output and javadocs for the core project
//to the api jar
from project(':core').sourceSets.main.output
from project(':core').sourceSets.main.allJava
from project(':core').javadoc.destinationDir
//Skip the plugin additions because these are for the implementation not the api
exclude '**/plugin/**'
exclude 'plugin.yml'
exclude 'config.yml'
}
artifacts {
archives apiJar
}
publishing {
publications {
api(MavenPublication) {
artifactId "${rootProject.name}-api"
artifact apiJar
}
impl(MavenPublication) {
from components.java
}
}
}