Skip to content

Commit

Permalink
Merge pull request #27 from xdev-software/update-from-template
Browse files Browse the repository at this point in the history
Update from template
  • Loading branch information
AB-xdev authored Jun 24, 2024
2 parents c7bd92e + fca3d8e commit aaf6f6e
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 23 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@

# Force sh files to have LF
*.sh text eol=lf

# Force MVN Wrapper Linux files LF
mvnw text eol=lf
.mvn/wrapper/maven-wrapper.properties text eol=lf
1 change: 1 addition & 0 deletions .github/.lycheeignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Ignorefile for broken link check
localhost
mvnrepository.com
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/${{ env.PRIMARY_MAVEN_MODULE }}-*.jar
if-no-files-found: error

code-style:
checkstyle:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}

Expand All @@ -90,3 +90,40 @@ jobs:

- name: Run Checkstyle
run: ./mvnw -B checkstyle:check -P checkstyle -T2C

pmd:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}

strategy:
matrix:
java: [17]
distribution: [temurin]

steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
cache: 'maven'

- name: Run PMD
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C

- name: Run CPD (Copy Paste Detector)
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C

- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: pmd-report
if-no-files-found: ignore
path: |
target/site/*.html
target/site/css/**
target/site/images/logos/maven-feather.png
target/site/images/external.png
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
pull-requests: write

jobs:
check_code: # Validates the code
check-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -45,9 +45,9 @@ jobs:
exit 1
fi
prepare_release:
prepare-release:
runs-on: ubuntu-latest
needs: [check_code]
needs: [check-code]
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
Expand Down Expand Up @@ -93,15 +93,15 @@ jobs:
release_name: v${{ steps.version.outputs.release }}
commitish: master
body: |
## [Changelog](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information.
## [Changelog](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information.
## Installation
Download the javaagent from the assets section below and [attach it to your java application](https://github.com/xdev-software/thread-origin-agent#usage).
publish_assets:
publish-assets:
runs-on: ubuntu-latest
needs: [prepare_release]
needs: [prepare-release]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:

publish-pages:
runs-on: ubuntu-latest
needs: [prepare_release]
needs: [prepare-release]
steps:
- uses: actions/checkout@v4

Expand All @@ -156,9 +156,9 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site

after_release:
after-release:
runs-on: ubuntu-latest
needs: [publish_assets]
needs: [publish-assets]
steps:
- uses: actions/checkout@v4

Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ buildNumber.properties
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*


# bin / compiled stuff
target/


# JRebel
**/resources/rebel.xml
**/resources/rebel-remote.xml
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We would absolutely love to get the community involved, and we welcome any form
### Ways to help
* **Report bugs**<br/>Create an issue or send a pull request
* **Send pull requests**<br/>If you want to contribute code, check out the development instructions below.
* However when contributing new features, please first discuss the change you wish to make via issue with the owners of this repository before making a change. Otherwise your work might be rejected and your effort was pointless.
* However when contributing larger new features, please first discuss the change you wish to make via issue with the owners of this repository before making it.<br/>Otherwise your work might be rejected and your effort was pointless.

We also encourage you to read the [contribution instructions by GitHub](https://docs.github.com/en/get-started/quickstart/contributing-to-projects).

Expand All @@ -27,6 +27,7 @@ You should have the following things installed:
* Install the following plugins:
* [Save Actions](https://plugins.jetbrains.com/plugin/22113) - Provides save actions, like running the formatter or adding ``final`` to fields
* [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis
* You may consider disabling telemetry in the settings under ``Tools > Sonarlint -> About``
* [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis
* Import the project
* Ensure that everything is encoded in ``UTF-8``
Expand All @@ -36,7 +37,6 @@ You should have the following things installed:
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/thread-origin-agent/release.yml?branch=master)](https://github.com/xdev-software/thread-origin-agent/actions/workflows/release.yml)

Before releasing:
* Consider doing a [test-deployment](https://github.com/xdev-software/thread-origin-agent/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
* Check the [changelog](CHANGELOG.md)

If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/thread-origin-agent/checkBuild.yml?branch=develop)](https://github.com/xdev-software/thread-origin-agent/actions/workflows/checkBuild.yml?query=branch%3Adevelop)
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/thread-origin-agent/check-build.yml?branch=develop)](https://github.com/xdev-software/thread-origin-agent/actions/workflows/check-build.yml?query=branch%3Adevelop)

# Thread Origin Agent

Expand Down
64 changes: 62 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<module>thread-origin-agent</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
Expand All @@ -28,20 +33,75 @@

<profiles>
<profile>
<!-- Disable checkstyle in root module as there is nothing to check -->
<id>checkstyle</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.4.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.17.0</version>
</dependency>
</dependencies>
<configuration>
<configLocation>.config/checkstyle/checkstyle.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>pmd</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.23.0</version>
<configuration>
<skip>true</skip>
<includeTests>true</includeTests>
<printFailingErrors>true</printFailingErrors>
<rulesets>
<ruleset>.config/pmd/ruleset.xml</ruleset>
</rulesets>
</configuration>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.2.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<!-- Required for reporting -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.4.0</version>
</plugin>
</plugins>
</reporting>
</profile>
</profiles>
</project>
12 changes: 11 additions & 1 deletion renovate.json5
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"rebaseWhen": "behind-base-branch"
"rebaseWhen": "behind-base-branch",
"packageRules": [
{
"description": "Ignore project internal dependencies",
"packagePattern": "^software.xdev:thread-origin-agent",
"datasources": [
"maven"
],
"enabled": false
}
]
}
44 changes: 43 additions & 1 deletion thread-origin-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.5.0</version>
<version>3.6.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down Expand Up @@ -181,6 +181,7 @@
</dependencies>
<configuration>
<configLocation>../.config/checkstyle/checkstyle.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<executions>
<execution>
Expand All @@ -193,5 +194,46 @@
</plugins>
</build>
</profile>
<profile>
<id>pmd</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.23.0</version>
<configuration>
<includeTests>true</includeTests>
<printFailingErrors>true</printFailingErrors>
<rulesets>
<ruleset>../.config/pmd/ruleset.xml</ruleset>
</rulesets>
</configuration>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.2.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<!-- Required for reporting -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.4.0</version>
</plugin>
</plugins>
</reporting>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public static void premain(final String agentArgument, final Instrumentation ins
log("Retransformed loaded classes; " + success + "x successful, " + unmodifiable + "x unmodifiable");
}

@SuppressWarnings({"PMD.CognitiveComplexity", "PMD.NPathComplexity"})
@Override
public byte[] transform(
final ClassLoader loader,
Expand Down

0 comments on commit aaf6f6e

Please sign in to comment.