-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
106 lines (87 loc) · 2.7 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
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
}
group 'dev.ultreon.corelibs'
version '0.3.0'
mkdir("${rootProject.projectDir}/.mvnrepo")
allprojects {
apply plugin: 'java'
apply plugin: "java-library"
apply plugin: 'maven-publish'
group 'dev.ultreon.corelibs'
archivesBaseName = "corelibs-$project.name"
def admin = rootProject.hasProperty('sonatypeUsername')
repositories {
mavenCentral()
}
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:5.9.0"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.9.0"
implementation "org.jetbrains:annotations:$annotations_version"
}
processResources {
from file("$rootProject.projectDir/LICENSE.md")
}
test {
useJUnitPlatform()
}
java {
withSourcesJar()
}
compileJava {
sourceCompatibility "1.8"
targetCompatibility "1.8"
}
jar.archiveBaseName = "corelibs-$project.name"
sourcesJar.archiveBaseName = "corelibs-$project.name"
publishing {
publications {
register('mavenJava', MavenPublication) {
from components.java
}
}
publishing {
repositories {
repositories {
maven {
url = uri("https://gitlab.com/api/v4/projects/60097152/packages/maven")
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = findProperty("gitLabPrivateToken").toString() // the variable resides in $GRADLE_USER_HOME/gradle.properties
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
}
}
afterEvaluate {
publish {
dependsOn "build"
}
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
}
afterEvaluate {
javadoc {
source(subprojects.collect { subproject ->
subproject.sourceSets.main.allJava.sourceDirectories
})
title = "CoreLibs"
description = "CoreLibs is the core library collection for Ultreon Team projects."
setDestinationDir(file("$rootProject.projectDir/build/docs/javadoc"))
// Configure the classpath
classpath = files(subprojects.collect { subproject ->
subproject.sourceSets.main.compileClasspath
})
(options as StandardJavadocDocletOptions).links(
"https://javadoc.io/doc/org.jetbrains/annotations/$annotations_version",
)
}
}