This repository has been archived by the owner on Aug 15, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
125 lines (107 loc) · 3.1 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
124
125
plugins {
id 'fabric-loom' version '0.5-SNAPSHOT'
id 'java-library'
id 'maven-publish'
id 'me.qoomon.git-versioning' version '3.0.0'
id "org.sonarqube" version "3.0"
}
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
def releasesRepoUrl = "https://nexus.sandboxpowered.org/repository/maven-releases/"
def snapshotsRepoUrl = "https://nexus.sandboxpowered.org/repository/maven-snapshots/"
def ENV = System.getenv()
archivesBaseName = project.archives_base_name
group = project.maven_group
version = "${project.sandbox_version}-SNAPSHOT"
gitVersioning.apply {
branch {
pattern = 'develop'
versionFormat = '${version}'
}
branch {
pattern = 'feature/(?<feature>.+)'
versionFormat = '${feature}-SNAPSHOT'
}
tag {
pattern = 'release/(?<tagVersion>[0-9].*)'
versionFormat = '${tagVersion}'
}
commit {
versionFormat = '${commit.short}'
}
}
minecraft {
accessWidener = file("src/main/resources/META-INF/sandbox-fabric.accesswidener")
}
allprojects {
apply plugin: 'java'
}
repositories {
maven { url 'https://nexus.sandboxpowered.org/repository/maven-public/' }
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_mappings}"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
runtimeOnly('org.apache.logging.log4j:log4j-slf4j-impl:2.8.1') {
transitive = false
}
runtimeOnly project(':TestAddon')
implementation platform('org.sandboxpowered.api:api:0.4.+')
include implementation('org.sandboxpowered.api:base')
include implementation('org.sandboxpowered.api:rendering')
include implementation('org.sandboxpowered.api:resources')
compileOnly 'org.jetbrains:annotations:19.0.0'
include implementation( 'com.electronwill.night-config:core:3.6.0')
include implementation('com.electronwill.night-config:toml:3.6.0')
include implementation('com.github.zafarkhaja:java-semver:0.9.0')
include implementation('org.sandboxpowered:SimpleEventHandler:2.0.3')
implementation 'com.google.guava:guava:21.0'
implementation 'org.apache.commons:commons-lang3:3.9'
}
processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
jar {
from "LICENSE"
}
sonarqube {
properties {
property "sonar.projectKey", "SandboxPowered_Sandbox"
property "sonar.organization", "sandboxpowered"
property "sonar.host.url", "https://sonarcloud.io"
}
}
publishing {
publications {
maven(MavenPublication) {
artifact remapJar
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
repositories {
maven {
url = rootProject.version.endsWith("-SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username ENV.MAVEN_USER
password ENV.MAVEN_PASS
}
}
}
}