Skip to content

Commit

Permalink
3.0.0 release
Browse files Browse the repository at this point in the history
1. **Imports Updated:**
   - Replaced `BiConsumer` with `Consumer`.

2. **ThisProject Class:**
   - Moved the `forceImplementation` comment.
   - Added comments for adding additional plugins.
   - Rearranged and clarified dependency addition comments.

3. **Class Removed:**
   - Removed `Plugins` class definition.

4. **ThirdPartyPlugins Class:**
   - Added instantiation in static block of `JPM` class to ensure plugins are added.

5. **Dependency Class:**
   - Added `fromGradleString` static method.
   - Added `excludedDependencies` and `type` attributes.
   - Added `exclude` methods.
   - Updated `toString` and `toXML` methods to handle new attributes.

6. **Repository Class:**
   - Added `isSnapshotsAllowed` attribute.
   - Updated `toXML` method to handle `isSnapshotsAllowed`.

7. **XML Class:**
   - Renamed `getOrCreateElement` to `getElementOrCreate`.
   - Added `remove` and `rename` methods.
   - Added `getElementOrNull` helper method.

8. **Plugin Class:**
   - Updated `beforeToXMLListeners` to use `Consumer<Details>`.
   - Removed configuration, executions, and dependencies fields.
   - Added `Details` inner class to encapsulate plugin details and manage configuration, executions, and dependencies.
   - Updated `toXML` method to use `Details`.

9. **Execution Class:**
   - Updated `toXML` method to handle optional `id`.

10. **Project Class:**
    - Defaulted `plugins` to `JPM.plugins`.
    - Added `profiles` attribute and related methods.
    - Updated `testImplementation`, `implementation`, `addDependency`, and `forceImplementation` methods to return `Dependency`.
    - Added `putPlugin` method for plugin management.
    - Added `addProfile` and `toXML` methods.
    - Updated `generatePom` to use `toXML`.

11. **Profile Class:**
    - Added `Profile` class extending `Project`.
    - Overridden `toXML` method for profiles.
  • Loading branch information
Osiris-Team committed Aug 3, 2024
1 parent 5a8b572 commit 7412b66
Show file tree
Hide file tree
Showing 2 changed files with 299 additions and 141 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,21 @@ class ThisProject extends JPM.Project {
this.jarName = "my-project.jar";
this.fatJarName = "my-project-with-dependencies.jar";

// Add some example dependencies
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.3");
implementation("org.apache.commons:commons-lang3:3.12.0");
// If there are duplicate dependencies with different versions force a specific version like so:
//forceImplementation("org.apache.commons:commons-lang3:3.12.0");

// Add some compiler arguments
// Add dependencies
implementation("org.apache.commons:commons-lang3:3.12.0");
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.3");

// Add compiler arguments
addCompilerArg("-Xlint:unchecked");
addCompilerArg("-Xlint:deprecation");

// Add additional plugins
//putPlugin("org.codehaus.mojo:exec-maven-plugin:1.6.0", d -> {
// d.putConfiguration("mainClass", this.mainClass);
//});
}

public static void main(String[] _args) throws Exception {
Expand All @@ -48,19 +54,13 @@ class ThisProject extends JPM.Project {
}
}

class Plugins extends JPM.Plugins{
// Add your Maven Plugins using the JPM.Plugin class here and
// take a look at "JPM.AssemblyPlugin" class further below to get started
}

class ThirdPartyPlugins extends JPM.Plugins{
// Add third party plugins below, find them here: https://github.com/topics/1jpm-plugin?o=desc&s=updated
// (If you want to develop a plugin take a look at "JPM.AssemblyPlugin" class further below to get started)
}

// 1JPM version 2.2.0 by Osiris-Team: https://github.com/Osiris-Team/1JPM
// 1JPM version 3.0.0 by Osiris-Team: https://github.com/Osiris-Team/1JPM
// To upgrade JPM, replace the JPM class below with its newer version
public class JPM {
//...
}
```
Expand Down Expand Up @@ -99,7 +99,7 @@ A workaround for this would be developing a task like "minifyProject" which woul

## Tipps
- You can use ChatGTP (or another LLM) to easily port your current Maven/Gradle based project over to 1JPM,
by sending it the above example `ThisProject` class and your current build config files (pom.xml/build.gradle),
by sending it the above example `ThisProject` class and your current build details files (pom.xml/build.gradle),
then prompting it something like: "Port my current Maven/Gradle project to the JPM build tool, by modifing the ThisProject class accordingly".
If you have additional plugins also send it an example plugin from within the JPM class.

Expand Down
Loading

0 comments on commit 7412b66

Please sign in to comment.