-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
97 lines (79 loc) · 2.34 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
plugins {
id 'java'
id 'org.ajoberstar.grgit' version '5.2.1'
}
group = "${project_group}"
version = "${project_version}"
allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
eclipse {
classpath {
downloadSources = true
}
}
idea {
module {
downloadSources = true
}
}
compileJava {
options.encoding = "UTF-8"
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(project.java_version))
}
repositories {
mavenCentral()
maven {
url "https://repository.atlasworld.fr/repository/maven-public/"
}
}
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
publishing {
boolean isSnapshot = System.getenv("RELEASE") != 'true';
repositories {
maven {
name 'AtlasWorld-Repo'
def release = "https://repository.atlasworld.fr/repository/maven-release/"
def snapshot = "https://repository.atlasworld.fr/repository/maven-snapshot/"
url = isSnapshot ? snapshot : release
credentials {
username = System.getenv("AW_REPO_USERNAME")
password = System.getenv("AW_REPO_PASSWORD")
}
metadataSources {
gradleMetadata()
}
}
}
publications {
AtlasCommon(MavenPublication) {
from components.java
def snapshot = "${project_version}-${grgit.head().id.subSequence(0, 5)}"
try {
version = isSnapshot ? snapshot : grgit.tag.list().get(0).getName();
} catch (IndexOutOfBoundsException e) {
version = "undefined"
}
pom {
name = 'AtlasCommon'
description = 'Common Code Utilities for AtlasWorld.'
licenses {
license {
name = 'GNU-GPL-v2.0'
url = 'https://github.com/AtlasWorldMC/AtlasCommon/blob/master/LICENSE'
}
}
}
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
}