-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
115 lines (101 loc) · 2.93 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
ext{
versions = [:]
libraries = [:]
}
versions.arc = "v145"
libraries.jnigen = [
"com.github.libgdx.gdx-jnigen:gdx-jnigen:$versions.jnigen"
]
libraries.getArc = { String moduleName ->
return "com.github.Anuken.Arc:$moduleName:${versions.arc}"
}
libraries.arcCore = libraries.getArc("arc-core")
allprojects{
if(project.name.startsWith("my")) return;
apply plugin: 'maven-publish'
group = 'com.github.Zelaux.ZelauxArcLib'
version = '1.0'
buildscript{
repositories{
mavenCentral()
maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" }
google()
maven{ url 'https://jitpack.io' }
}
}
repositories{
mavenLocal()
google()
mavenCentral()
maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven{ url "https://oss.sonatype.org/content/repositories/releases/" }
maven{ url 'https://jitpack.io' }
maven{ url 'https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository/' }
}
ext.aproj = { String module ->
if(findProject(module) != null){
return project(module)
}else{
return project(":ZelauxArcLib" + module)
}
}
tasks.withType(JavaCompile){
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.encoding = "UTF-8"
}
}
Set<Project> projects = (System.getenv("JITPACK") != "true" ? subprojects - aproj(":test") : subprojects)
String calculateName(Project proj){
// Set<Project> projects = System.getenv("JITPACK") != "true" ? rootProject.subprojects - project(":test") : rootProject.subprojects
if(proj.parent == rootProject) return proj.name;
return calculateName(proj.parent) + "-" + proj.name
}
configure(projects){
if(project.name.startsWith("my")) return;
apply plugin: "java-library"
compileJava{
options.fork = true
options.incremental = true
}
java{
withJavadocJar()
withSourcesJar()
}
def selfProject = project
publishing{
publications{
maven(MavenPublication){
from components.java
artifactId = calculateName(selfProject)
// name
}
}
}
}
void eachChild(Set<Project> set){
configure(set){
dependencies{
if(subprojects.size() == 0){
compileOnly "org.jetbrains:annotations:24.0.1"
testImplementation 'junit:junit:4.13.1'
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.8.2")
}
}
// sourceSets
eachChild(subprojects)
}
}
eachChild(projects)
/*
static void printChild(int indent, Project project){
println "- ".repeat(indent)+project.name
for(final def sub in project.subprojects){
printChild(indent+1,sub)
}
}
printChild(0,project)
*/
repositories{
mavenCentral()
}