Skip to content
This repository was archived by the owner on Jan 24, 2026. It is now read-only.

Commit 57acf5f

Browse files
committed
Basic Gradle Setup
0 parents  commit 57acf5f

File tree

16 files changed

+591
-0
lines changed

16 files changed

+591
-0
lines changed

.gitignore

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
2+
# Created by https://www.gitignore.io/api/gradle,intellij
3+
# Edit at https://www.gitignore.io/?templates=gradle,intellij
4+
5+
### Intellij ###
6+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
7+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
8+
9+
# User-specific stuff
10+
.idea/**/workspace.xml
11+
.idea/**/tasks.xml
12+
.idea/**/usage.statistics.xml
13+
.idea/**/dictionaries
14+
.idea/**/shelf
15+
16+
# Generated files
17+
.idea/**/contentModel.xml
18+
19+
# Sensitive or high-churn files
20+
.idea/**/dataSources/
21+
.idea/**/dataSources.ids
22+
.idea/**/dataSources.local.xml
23+
.idea/**/sqlDataSources.xml
24+
.idea/**/dynamic.xml
25+
.idea/**/uiDesigner.xml
26+
.idea/**/dbnavigator.xml
27+
28+
# Gradle
29+
.idea/**/gradle.xml
30+
.idea/**/libraries
31+
32+
# Gradle and Maven with auto-import
33+
# When using Gradle or Maven with auto-import, you should exclude module files,
34+
# since they will be recreated, and may cause churn. Uncomment if using
35+
# auto-import.
36+
# .idea/modules.xml
37+
# .idea/*.iml
38+
# .idea/modules
39+
# *.iml
40+
# *.ipr
41+
42+
# CMake
43+
cmake-build-*/
44+
45+
# Mongo Explorer plugin
46+
.idea/**/mongoSettings.xml
47+
48+
# File-based project format
49+
*.iws
50+
51+
# IntelliJ
52+
out/
53+
54+
# mpeltonen/sbt-idea plugin
55+
.idea_modules/
56+
57+
# JIRA plugin
58+
atlassian-ide-plugin.xml
59+
60+
# Cursive Clojure plugin
61+
.idea/replstate.xml
62+
63+
# Crashlytics plugin (for Android Studio and IntelliJ)
64+
com_crashlytics_export_strings.xml
65+
crashlytics.properties
66+
crashlytics-build.properties
67+
fabric.properties
68+
69+
# Editor-based Rest Client
70+
.idea/httpRequests
71+
72+
# Android studio 3.1+ serialized cache file
73+
.idea/caches/build_file_checksums.ser
74+
75+
### Intellij Patch ###
76+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
77+
78+
# *.iml
79+
# modules.xml
80+
# .idea/misc.xml
81+
# *.ipr
82+
83+
# Sonarlint plugin
84+
.idea/sonarlint
85+
86+
### Gradle ###
87+
.gradle
88+
build/
89+
90+
# Ignore Gradle GUI config
91+
gradle-app.setting
92+
93+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
94+
!gradle-wrapper.jar
95+
96+
# Cache of project
97+
.gradletasknamecache
98+
99+
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
100+
# gradle/wrapper/gradle-wrapper.properties
101+
102+
### Gradle Patch ###
103+
**/build/
104+
105+
# End of https://www.gitignore.io/api/gradle,intellij

.idea/$PRODUCT_WORKSPACE_FILE$

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.jitpack.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
jdk:
2+
- oraclejdk8

build.gradle

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
buildscript {
2+
repositories.gradlePluginPortal()
3+
dependencies.classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.0"
4+
}
5+
6+
apply plugin: 'java-library'
7+
8+
group 'io.codebottle'
9+
version '0.0.0'
10+
11+
apply from: 'gradle/vars.gradle'
12+
13+
sourceCompatibility = 1.8
14+
targetCompatibility = 1.8
15+
16+
wrapper {
17+
gradleVersion = '5.6'
18+
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
19+
}
20+
21+
task sourcesJar(type: Jar) {
22+
from sourceSets.main.allJava
23+
archiveClassifier = "sources"
24+
}
25+
26+
task javadocJar(type: Jar) {
27+
from javadoc.destinationDir
28+
archiveClassifier = "javadoc"
29+
}
30+
31+
javadoc {
32+
source = sourceSets.main.java
33+
options {
34+
encoding = 'UTF-8'
35+
destinationDirectory(file("./docs/"))
36+
links = [
37+
"https://docs.oracle.com/javase/8/docs/api/",
38+
"https://docs.oracle.com/javaee/7/api/"
39+
]
40+
}
41+
}
42+
43+
compileJava.options.encoding = 'UTF-8'
44+
repositories.jcenter()
45+
46+
dependencies {
47+
compileOnly 'org.jetbrains:annotations:17.0.0'
48+
49+
testImplementation 'junit:junit:4.12'
50+
}
51+
52+
sourceSets {
53+
main.java.srcDirs = ["src\\main\\java"]
54+
test.java.srcDirs = ["src\\test\\java"]
55+
}
56+
57+
apply from: 'gradle/publishing.gradle'

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
signing.gnupg.executable=gpg
2+
signing.gnupg.useLegacyGpg=true
3+
signing.gnupg.keyName=2F12CBAA5DE8379AB89169FADB6ECFAA4ADD08F5

gradle/publishing.gradle

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: "io.codearte.nexus-staging"
3+
4+
publishing {
5+
repositories {
6+
maven {
7+
url = snapshot
8+
? "https://oss.sonatype.org/content/repositories/snapshots"
9+
: "https://oss.sonatype.org/service/local/staging/deploy/maven2"
10+
name = "Sonatype"
11+
12+
credentials {
13+
username sonatypeUsername
14+
password sonatypePassword
15+
}
16+
}
17+
}
18+
19+
publications {
20+
mavenJava(MavenPublication) {
21+
artifactId = artifactName
22+
from components.java
23+
24+
artifact sourcesJar
25+
artifact javadocJar
26+
27+
pom {
28+
name = projectName
29+
description = projectDescription
30+
inceptionYear = '2019'
31+
url = 'https://github.com/codebottle-io/codebottle-java'
32+
33+
licenses {
34+
license {
35+
name = 'MIT License'
36+
url = 'http://www.opensource.org/licenses/mit-license.php'
37+
}
38+
}
39+
40+
developers {
41+
developer {
42+
id = "burdoto"
43+
name = "Tobias Burdow"
44+
email = "burdoto@outlook.com"
45+
}
46+
}
47+
48+
scm {
49+
connection = 'scm:git:git://github.com/codebottle-io/codebottle-java.git'
50+
developerConnection = 'scm:git:ssh://github.com/codebottle-io/codebottle-java.git'
51+
url = 'https://github.com/codebottle-io/codebottle-java'
52+
}
53+
}
54+
}
55+
}
56+
}
57+
58+
task generateGitHubPom(type: GenerateMavenPom) {
59+
destination = "pom.xml"
60+
pom = publishing.publications.mavenJava.pom
61+
}
62+
63+
if (!System.getenv().containsKey("JITPACK")) {
64+
apply plugin: 'signing'
65+
66+
signing {
67+
useGpgCmd()
68+
sign publishing.publications.mavenJava
69+
}
70+
}
71+
72+
tasks.removeAll([promoteRepository, closeAndPromoteRepository, getStagingProfile])
73+
74+
nexusStaging {
75+
username sonatypeUsername
76+
password sonatypePassword
77+
}

0 commit comments

Comments
 (0)