Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gradle): initialize gradle plugin #99

Merged
merged 17 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ jobs:
run: |
./mvnw spotless:check
./mvnw clean install -DskipTests
cd hawkeye-gradle-plugin
./gradlew assemble

unittest:
if: (github.event_name != 'schedule') || (github.repository == 'korandoru/hawkeye')
Expand Down Expand Up @@ -89,7 +91,17 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Maven verify
run: ./mvnw clean verify
run: ./mvnw clean install
- name: Gradle verify
working-directory: hawkeye-gradle-plugin
run: ./gradlew test
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: junit-test-results
path: '**/build/test-results/test/TEST-*.xml'
retention-days: 1

docker:
if: (github.event_name != 'schedule') || (github.repository == 'korandoru/hawkeye')
Expand Down
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Prerequisite - set up [your OSSRH account](https://central.sonatype.org/publish/
First, prepare the release:

```shell
./mvnw release:prepare
./mvnw -Prelease,-develop release:prepare
```

Second, perform the release:

```shell
./mvnw release:perform
./mvnw -Prelease,-develop release:perform
```

This step will publish the artifacts to Maven Central, and create Git tag `vX.Y.Z` locally.
Expand Down
3 changes: 1 addition & 2 deletions hawkeye-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<artifactId>hawkeye-cli</artifactId>

<properties>
<spring-boot-maven-plugin.version>2.7.0</spring-boot-maven-plugin.version>
<spring-boot-maven-plugin.version>3.1.4</spring-boot-maven-plugin.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -86,5 +86,4 @@
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ private Builder() {
// always use #of methods
}

public HawkEyeConfig.Builder setBaseDir(String baseDir) {
this.baseDir = Path.of(baseDir);
return this;
}

public HawkEyeConfig.Builder addExcludes(List<String> excludes) {
this.excludes = new ArrayList<>(this.excludes);
this.excludes.addAll(excludes);
Expand Down
2 changes: 2 additions & 0 deletions hawkeye-gradle-plugin/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/gradlew text eol=lf
*.bat text eol=crlf
5 changes: 5 additions & 0 deletions hawkeye-gradle-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
68 changes: 68 additions & 0 deletions hawkeye-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright 2023 Korandoru Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id 'java-gradle-plugin'
}

repositories {
mavenCentral()
mavenLocal()
}

sourceCompatibility = '17'
targetCompatibility = '17'

group = "io.korandoru.hawkeye"
version = {
def projectRootPOM = layout.projectDirectory.file("../pom.xml")
def projectPOMData = new groovy.xml.XmlParser().parse(projectRootPOM.getAsFile())
projectPOMData.version.text()
}()

ext {
assertjVersion = '3.11.1'
commonsIoVersion = '2.14.0'
junitVersion = '5.9.3'
}

dependencies {
implementation "${project.group}:hawkeye-core:${project.version}"

testImplementation "commons-io:commons-io:${commonsIoVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
testImplementation "org.assertj:assertj-core:${assertjVersion}"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

gradlePlugin {
website = "https://github.com/korandoru/hawkeye"
vcsUrl = "https://github.com/korandoru/hawkeye"

plugins {
hawkeye {
id = 'io.korandoru.hawkeye'
implementationClass = 'io.korandoru.hawkeye.gradle.plugin.HawkEyeGradlePlugin'
displayName = 'HawkEye license header plugin'
description = 'Integrate HawkEye license header utilities into Gradle plugin system.'
tags.set(['format', 'license', 'header', 'style'])
}
}
}

tasks.named('test') {
useJUnitPlatform()
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading