Skip to content

Commit 4e990d3

Browse files
author
TheSnoozer
committed
#1: Create first gradle-plugin prototype
1 parent 9c51b49 commit 4e990d3

File tree

12 files changed

+1009
-3
lines changed

12 files changed

+1009
-3
lines changed

.gitignore

+90-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,101 @@
1+
# https://github.com/github/gitignore/blob/main/Gradle.gitignore
12
.gradle
2-
/build/
3+
**/build/
4+
!src/**/build/
35

46
# Ignore Gradle GUI config
57
gradle-app.setting
68

79
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
810
!gradle-wrapper.jar
911

12+
# Avoid ignore Gradle wrappper properties
13+
!gradle-wrapper.properties
14+
1015
# Cache of project
1116
.gradletasknamecache
1217

13-
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
14-
# gradle/wrapper/gradle-wrapper.properties
18+
# Eclipse Gradle plugin generated files
19+
# Eclipse Core
20+
.project
21+
# JDT-specific (Eclipse Java Development Tools)
22+
.classpath
23+
24+
# https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
25+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
26+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
27+
28+
# User-specific stuff
29+
.idea/**/workspace.xml
30+
.idea/**/tasks.xml
31+
.idea/**/usage.statistics.xml
32+
.idea/**/dictionaries
33+
.idea/**/shelf
34+
35+
# AWS User-specific
36+
.idea/**/aws.xml
37+
38+
# Generated files
39+
.idea/**/contentModel.xml
40+
41+
# Sensitive or high-churn files
42+
.idea/**/dataSources/
43+
.idea/**/dataSources.ids
44+
.idea/**/dataSources.local.xml
45+
.idea/**/sqlDataSources.xml
46+
.idea/**/dynamic.xml
47+
.idea/**/uiDesigner.xml
48+
.idea/**/dbnavigator.xml
49+
50+
# Gradle
51+
.idea/**/gradle.xml
52+
.idea/**/libraries
53+
54+
# Gradle and Maven with auto-import
55+
# When using Gradle or Maven with auto-import, you should exclude module files,
56+
# since they will be recreated, and may cause churn. Uncomment if using
57+
# auto-import.
58+
# .idea/artifacts
59+
# .idea/compiler.xml
60+
# .idea/jarRepositories.xml
61+
# .idea/modules.xml
62+
# .idea/*.iml
63+
# .idea/modules
64+
# *.iml
65+
# *.ipr
66+
67+
# CMake
68+
cmake-build-*/
69+
70+
# Mongo Explorer plugin
71+
.idea/**/mongoSettings.xml
72+
73+
# File-based project format
74+
*.iws
75+
76+
# IntelliJ
77+
out/
78+
79+
# mpeltonen/sbt-idea plugin
80+
.idea_modules/
81+
82+
# JIRA plugin
83+
atlassian-ide-plugin.xml
84+
85+
# Cursive Clojure plugin
86+
.idea/replstate.xml
87+
88+
# SonarLint plugin
89+
.idea/sonarlint/
90+
91+
# Crashlytics plugin (for Android Studio and IntelliJ)
92+
com_crashlytics_export_strings.xml
93+
crashlytics.properties
94+
crashlytics-build.properties
95+
fabric.properties
96+
97+
# Editor-based Rest Client
98+
.idea/httpRequests
99+
100+
# Android studio 3.1+ serialized cache file
101+
.idea/caches/build_file_checksums.ser

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
# git-commit-id-gradle-plugin
22
Gradle plugin which includes build-time git repository information into an POJO / *.properties). Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments... :-)
3+
4+
# Compatibility Matrix
5+
This project requires at least 11 java and will rely on gradle's convention for configuration
6+
7+
With [Gradle's Compatibility Matrix](https://docs.gradle.org/current/userguide/compatibility.html) the
8+
minimum supported gradle version is 5.0.
9+
Unfortunately conventions only had been introduced with [gradle 5.1](https://docs.gradle.org/5.1/release-notes.html)
10+
so that is as of now the minimal supported version.
11+

build.gradle

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
plugins {
2+
id 'groovy'
3+
id 'java-gradle-plugin'
4+
id 'maven-publish'
5+
id 'signing'
6+
id 'idea'
7+
}
8+
9+
group = 'io.github.git-commit-id'
10+
version = '0.0.1-alpha'
11+
12+
repositories {
13+
mavenCentral()
14+
}
15+
16+
dependencies {
17+
implementation gradleApi()
18+
implementation 'io.github.git-commit-id:git-commit-id-plugin-core:6.0.0-rc.2'
19+
20+
// testImplementation 'junit:junit:4.12'
21+
// testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
22+
// testImplementation "org.junit.platform:junit-platform-suite:1.8.1"
23+
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.3'
24+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
25+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
26+
27+
testImplementation gradleTestKit()
28+
testImplementation localGroovy()
29+
}
30+
31+
tasks.withType(Test) {
32+
useJUnitPlatform()
33+
testLogging {
34+
exceptionFormat "full"
35+
events "started", "skipped", "passed", "failed"
36+
showStandardStreams true
37+
}
38+
}
39+
40+
task sourcesJar(type: Jar) {
41+
from sourceSets.main.allJava
42+
archiveClassifier = 'sources'
43+
}
44+
45+
task javadocJar(type: Jar) {
46+
from javadoc
47+
archiveClassifier = 'javadoc'
48+
}
49+
50+
javadoc {
51+
if(JavaVersion.current().isJava9Compatible()) {
52+
options.addBooleanOption('html5', true)
53+
}
54+
}
55+
56+
publishing {
57+
publications {
58+
mavenJava(MavenPublication) {
59+
from components.java
60+
artifact sourcesJar
61+
artifact javadocJar
62+
}
63+
}
64+
repositories {
65+
mavenLocal()
66+
}
67+
}
68+
69+
signing {
70+
sign publishing.publications.mavenJava
71+
}
72+
73+
gradlePlugin {
74+
// Define the plugin
75+
plugins {
76+
gitCommitIdPlugin {
77+
id = 'io.github.git-commit-id.gradle-plugin'
78+
implementationClass = 'io.github.git.commit.id.gradle.plugin.GitCommitIdPlugin'
79+
}
80+
}
81+
}
82+

gradle/wrapper/gradle-wrapper.jar

60.6 KB
Binary file not shown.
+6
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-8.1.1-bin.zip
4+
networkTimeout=10000
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)