-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
118 lines (100 loc) · 3.01 KB
/
build.gradle
File metadata and controls
118 lines (100 loc) · 3.01 KB
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
plugins {
id 'java'
id 'application'
id 'maven-publish'
}
group = 'fr.sandro642.github'
version = '0.4.8.2-STABLE'
// Générer une classe de version automatiquement
task generateVersionClass {
doLast {
def versionFile = file("$buildDir/generated/source/version/fr/sandro642/github/update/Version.java")
versionFile.parentFile.mkdirs()
versionFile.text = """
package fr.sandro642.github.update;
public class Version {
public static final String VERSION = "${project.version}";
}
"""
}
}
compileJava.dependsOn generateVersionClass
sourceSets.main.java.srcDir "$buildDir/generated/source/version"
tasks.register('printVersion') {
doLast {
println project.version
}
}
repositories {
mavenCentral()
maven {
url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
implementation 'io.projectreactor:reactor-core:3.6.9'
implementation 'org.springframework.boot:spring-boot-starter-webflux:3.2.2'
// Version moderne sans problèmes de dépendances
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
implementation 'com.google.code.gson:gson:2.10.1'
}
application {
mainClass = 'fr.sandro642.github.ConnectLib'
}
tasks.jar {
manifest {
attributes 'Main-Class': 'fr.sandro642.github.ConnectLib'
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.test {
useJUnitPlatform()
}
java {
withSourcesJar()
//withJavadocJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
groupId = project.group.toString()
artifactId = 'ConnectLib'
version = project.version.toString()
pom {
name = 'ConnectLib'
description = 'A library for connecting to APIs'
url = 'https://sandro642.github.io/connectlib'
licenses {
license {
name = 'The MIT License, Version 2.0'
url = 'https://github.com/Sandro642/ConnectLib/blob/main/LICENSE'
}
}
developers {
developer {
id = 'sandro642'
name = 'Sandro'
email = 'sandro33810@gmail.com'
}
}
scm {
connection = 'scm:git:git://github.com/sandro642/ConnectLib.git'
developerConnection = 'scm:git:ssh://github.com/sandro642/ConnectLib.git'
url = 'https://github.com/sandro642/ConnectLib'
}
}
}
}
repositories {
maven {
name = 'LocalRepo'
url = uri(layout.buildDirectory.dir('repo'))
}
}
}