forked from hibernate/hibernate-reactive
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hibernate#1956] Handling of version for release processing
- Loading branch information
Showing
8 changed files
with
250 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
plugins { | ||
id "java-gradle-plugin" | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
group = 'org.hibernate.reactive.build' | ||
version = '1.0.0-SNAPSHOT' | ||
|
||
|
||
dependencies { | ||
implementation gradleApi() | ||
} | ||
|
||
java { | ||
sourceCompatibility = 11 | ||
targetCompatibility = 11 | ||
} | ||
|
||
|
||
gradlePlugin { | ||
plugins { | ||
projectEnv { | ||
id = 'local.versions' | ||
implementationClass = 'org.hibernate.reactive.env.VersionsPlugin' | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = 'local-build-plugins' |
54 changes: 54 additions & 0 deletions
54
local-build-plugins/src/main/java/org/hibernate/reactive/env/ProjectVersion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package org.hibernate.reactive.env; | ||
|
||
/** | ||
* @author Steve Ebersole | ||
*/ | ||
public class ProjectVersion { | ||
final String major; | ||
final String minor; | ||
final boolean snapshot; | ||
|
||
private final String family; | ||
private final String fullName; | ||
|
||
ProjectVersion(String fullName) { | ||
this.fullName = fullName; | ||
|
||
try { | ||
final String[] hibernateVersionComponents = fullName.split( "\\." ); | ||
major = hibernateVersionComponents[0]; | ||
minor = hibernateVersionComponents[1]; | ||
} | ||
catch (Exception e) { | ||
throw new IllegalArgumentException( "Invalid version number: " + fullName + "." ); | ||
} | ||
|
||
family = major + "." + minor; | ||
snapshot = fullName.endsWith( "-SNAPSHOT" ); | ||
} | ||
|
||
public String getMajor() { | ||
return major; | ||
} | ||
|
||
public String getMinor() { | ||
return minor; | ||
} | ||
|
||
public String getFullName() { | ||
return fullName; | ||
} | ||
|
||
public String getFamily() { | ||
return family; | ||
} | ||
|
||
public boolean isSnapshot() { | ||
return snapshot; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return fullName; | ||
} | ||
} |
Oops, something went wrong.