Skip to content

Commit cc1ffe1

Browse files
authored
Initial commit
0 parents  commit cc1ffe1

File tree

12 files changed

+565
-0
lines changed

12 files changed

+565
-0
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.gradle/
2+
/.idea/
3+
/.vscode/
4+
/bin/
5+
/build/
6+
/out/
7+
*.iml

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Lenni0451
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.MD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Gradle Template
2+
A template project for my gradle based repos

build.gradle

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
plugins {
2+
id "java"
3+
id "maven-publish"
4+
id "signing"
5+
}
6+
7+
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
8+
compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = "UTF-8"
9+
10+
archivesBaseName = project.maven_name
11+
group = project.maven_group
12+
version = project.maven_version
13+
14+
configurations {
15+
include
16+
17+
implementation.extendsFrom include
18+
api.extendsFrom include
19+
}
20+
21+
repositories {
22+
mavenCentral()
23+
maven {
24+
name = "lenni0451 releases"
25+
url = "https://maven.lenni0451.net/releases"
26+
}
27+
//maven {
28+
// name = "Sonatype Snapshots"
29+
// url "https://oss.sonatype.org/content/repositories/snapshots/"
30+
//}
31+
32+
//ivy { //include "waterfall:1.19:504@jar"
33+
// url "https://papermc.io/api/v2/projects"
34+
// patternLayout {
35+
// artifact "/[organisation]/versions/[module]/builds/[revision]/downloads/[organisation]-[module]-[revision].[ext]"
36+
// }
37+
// metadataSources {
38+
// artifact()
39+
// }
40+
//}
41+
}
42+
43+
dependencies {
44+
if (new File(projectDir, "libs").exists()) {
45+
include fileTree(include: ["*.jar"], dir: "libs")
46+
}
47+
48+
implementation "com.google.code.findbugs:jsr305:3.0.2"
49+
//include "net.lenni0451:Reflect:1.0.0"
50+
}
51+
52+
java {
53+
withSourcesJar()
54+
withJavadocJar()
55+
}
56+
57+
processResources {
58+
//Config file: "version: ${version}"
59+
inputs.properties(
60+
"version": project.maven_version
61+
)
62+
63+
filesMatching("config") {
64+
expand(
65+
"version": project.maven_version
66+
)
67+
}
68+
}
69+
70+
artifacts {
71+
archives javadocJar, sourcesJar
72+
}
73+
74+
jar {
75+
dependsOn configurations.include
76+
from {
77+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
78+
configurations.include.collect {
79+
zipTree(it)
80+
}
81+
} {
82+
exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA"
83+
}
84+
85+
manifest {
86+
attributes(
87+
"Main-Class": "net.lenni0451.gradletemplate.Main",
88+
"Multi-Release": "true"
89+
)
90+
}
91+
}
92+
93+
test {
94+
useJUnitPlatform()
95+
testLogging {
96+
events "passed", "skipped", "failed"
97+
}
98+
maxParallelForks Runtime.runtime.availableProcessors()
99+
}
100+
101+
publishing {
102+
repositories {
103+
maven {
104+
name = "reposilite"
105+
def releasesUrl = "https://maven.lenni0451.net/releases"
106+
def snapshotsUrl = "https://maven.lenni0451.net/snapshots"
107+
url = project.maven_version.endsWith("SNAPSHOT") ? snapshotsUrl : releasesUrl
108+
109+
credentials(PasswordCredentials)
110+
authentication {
111+
basic(BasicAuthentication)
112+
}
113+
}
114+
maven {
115+
name = "ossrh"
116+
def releasesUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
117+
def snapshotsUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
118+
url = project.maven_version.endsWith("SNAPSHOT") ? snapshotsUrl : releasesUrl
119+
120+
credentials(PasswordCredentials)
121+
authentication {
122+
basic(BasicAuthentication)
123+
}
124+
}
125+
}
126+
publications {
127+
maven(MavenPublication) {
128+
artifactId = project.maven_name
129+
groupId = project.maven_group
130+
version = project.maven_version
131+
132+
from components.java
133+
134+
pom {
135+
name = rootProject.name
136+
description = "A template for gradle projects"
137+
url = "https://github.com/Lenni0451/GradleTemplate"
138+
licenses {
139+
license {
140+
name = "MIT License"
141+
url = "https://github.com/Lenni0451/GradleTemplate/blob/main/LICENSE"
142+
}
143+
}
144+
developers {
145+
developer {
146+
id = "Lenni0451"
147+
}
148+
}
149+
scm {
150+
connection = "scm:git:git://github.com/Lenni0451/GradleTemplate.git"
151+
developerConnection = "scm:git:ssh://github.com/Lenni0451/GradleTemplate.git"
152+
url = "github.com/Lenni0451/GradleTemplate"
153+
}
154+
}
155+
}
156+
}
157+
}
158+
159+
signing {
160+
sign configurations.archives
161+
sign publishing.publications.maven
162+
}
163+
164+
project.tasks.withType(PublishToMavenRepository).forEach {
165+
it.dependsOn(project.tasks.withType(Sign))
166+
}
167+
build.dependsOn(test)

gradle.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#Gradle settings
2+
org.gradle.daemon=true
3+
org.gradle.parallel=true
4+
org.gradle.configureondemand=true
5+
6+
#Maven settings
7+
maven_name=GradleTemplate
8+
maven_group=net.lenni0451
9+
maven_version=1.0.0

gradle/wrapper/gradle-wrapper.jar

60.1 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
4+
networkTimeout=10000
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)