blob: 3224ed45a8ae79c6c2939e51f2133835477c47ba (
plain)
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
|
import net.raphimc.javadowngrader.gradle.task.DowngradeJarTask
plugins {
id 'java'
id 'io.github.goooler.shadow' version '8.1.7'
id 'net.raphimc.java-downgrader' version '1.1.2'
id 'maven-publish'
}
defaultTasks 'allJar'
allprojects {
apply plugin: 'java'
group = 'com.leonardobishop'
version = '3.15'
sourceCompatibility = 21
targetCompatibility = 21
}
task allJar( type: Jar, dependsOn: subprojects.tasks['build'] ) {
if (project.findProperty('gitversion') == null || project.findProperty('gitversion') == 'true') {
ext.gitCommitHash = 'git rev-parse --verify --short HEAD'.execute().text.trim()
project.version = "${project.version}-${gitCommitHash}"
subprojects.each {
it.version = "${it.version}-${gitCommitHash}"
}
}
subprojects.each { subproject ->
from subproject.configurations.archives.allArtifacts.files.collect {
zipTree(it)
}
}
archiveBaseName = 'Quests'
}
tasks.register("java8Jar", DowngradeJarTask) {
input = tasks.jar.archiveFile.get().asFile
outputSuffix = "+java8"
compileClassPath = sourceSets.main.compileClasspath
}.get().dependsOn("allJar")
allJar.finalizedBy("java8Jar")
artifacts {
archives allJar
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'com.leonardobishop'
artifactId = 'quests'
version = project.version
artifact allJar
pom.withXml {
asNode().dependencies.dependency.each { dep ->
dep.parent().remove(dep)
}
}
}
}
repositories {
maven {
credentials {
username = project.findProperty('mavenUser') ?: System.getenv('MAVEN_USER')
password = project.findProperty('mavenPassword') ?: System.getenv('MAVEN_PASSWORD')
}
url = "https://repo.leonardobishop.com/releases/"
}
}
}
|