mirror of
https://github.com/rife2/bld
synced 2026-04-17 13:54:08 +02:00
Compare commits
3 commits
e3b1e92426
...
5d953cce43
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d953cce43 | ||
|
|
91a621dfea | ||
|
|
5af8ca7b2e |
|
|
@ -2,12 +2,12 @@
|
|||
<library name="bld">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.2-SNAPSHOT.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.2-SNAPSHOT-sources.jar!/" />
|
||||
</SOURCES>
|
||||
<excluded>
|
||||
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
[](https://rife2.com/bld)
|
||||
[](https://github.com/rife2/bld/releases/latest)
|
||||
[](https://maven-badges.herokuapp.com/maven-central/com.uwyn.rife2/bld)
|
||||
[](https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/bld/)
|
||||
[](https://central.sonatype.com/repository/maven-snapshots/com/uwyn/rife2/bld/)
|
||||
[](https://github.com/rife2/bld/actions/workflows/bld.yml)
|
||||
[](https://github.com/rife2/rife2/actions/workflows/bld.yml)
|
||||
|
||||
|
|
|
|||
2
core
2
core
|
|
@ -1 +1 @@
|
|||
Subproject commit f8bde83ca806403dd8f37294239ac77dba8ad010
|
||||
Subproject commit ac900b7496ced0a2a38b3ceeba6ad57155e4c508
|
||||
Binary file not shown.
|
|
@ -8,4 +8,4 @@ bld.javaOptions=
|
|||
bld.javacOptions=
|
||||
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES
|
||||
bld.sourceDirectories=core/src/bld/java
|
||||
bld.version=2.2.1
|
||||
bld.version=2.2.2-SNAPSHOT
|
||||
|
|
@ -86,7 +86,7 @@ public class BldBuild extends AbstractRife2Build {
|
|||
|
||||
publishOperation()
|
||||
.repository(version.isSnapshot() ? repository("rife2-snapshots") : repository("rife2-releases"))
|
||||
.repository(version.isSnapshot() ? repository("sonatype-snapshots") : repository("sonatype-releases"))
|
||||
.repository(version.isSnapshot() ? repository("central-snapshots") : repository("central-releases"))
|
||||
.repository(repository("github"))
|
||||
.info(new PublishInfo()
|
||||
.groupId("com.uwyn.rife2")
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ public record Repository(String location, String username, String password) {
|
|||
public static final Repository SONATYPE_RELEASES_LEGACY = new Repository("https://oss.sonatype.org/service/local/staging/deploy/maven2/");
|
||||
public static final Repository SONATYPE_SNAPSHOTS = new Repository("https://s01.oss.sonatype.org/content/repositories/snapshots/");
|
||||
public static final Repository SONATYPE_SNAPSHOTS_LEGACY = new Repository("https://oss.sonatype.org/content/repositories/snapshots/");
|
||||
public static final Repository CENTRAL_RELEASES = new Repository("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/");
|
||||
public static final Repository CENTRAL_SNAPSHOTS = new Repository("https://central.sonatype.com/repository/maven-snapshots/");
|
||||
public static final Repository RIFE2_RELEASES = new Repository("https://repo.rife2.com/releases/");
|
||||
public static final Repository RIFE2_SNAPSHOTS = new Repository("https://repo.rife2.com/snapshots/");
|
||||
|
||||
|
|
@ -98,6 +100,8 @@ public record Repository(String location, String username, String password) {
|
|||
case "SONATYPE_RELEASES_LEGACY" -> Repository.SONATYPE_RELEASES_LEGACY;
|
||||
case "SONATYPE_SNAPSHOTS" -> Repository.SONATYPE_SNAPSHOTS;
|
||||
case "SONATYPE_SNAPSHOTS_LEGACY" -> Repository.SONATYPE_SNAPSHOTS_LEGACY;
|
||||
case "CENTRAL_RELEASES" -> Repository.CENTRAL_RELEASES;
|
||||
case "CENTRAL_SNAPSHOTS" -> Repository.CENTRAL_SNAPSHOTS;
|
||||
default -> new Repository(locationOrName);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,14 +133,18 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
var resolution = new VersionResolution(properties());
|
||||
var resolver = new DependencyResolver(resolution, artifactRetriever(), List.of(repository), new Dependency(info().groupId(), info().artifactId(), info().version()));
|
||||
var snapshot_meta = resolver.getSnapshotMavenMetadata();
|
||||
snapshot_build_number = snapshot_meta.getSnapshotBuildNumber() + 1;
|
||||
var build_number_meta = snapshot_meta.getSnapshotBuildNumber();
|
||||
if (build_number_meta == null) {
|
||||
throw new DependencyException("Snapshot metadata build number doesn't exist.");
|
||||
}
|
||||
snapshot_build_number = build_number_meta + 1;
|
||||
} catch (DependencyException e) {
|
||||
// start the build number from the beginning
|
||||
System.out.println("Unable to retrieve previous snapshot metadata, using first build number.");
|
||||
System.out.println("This is expected for a first publication or for publication to a staging repository.");
|
||||
}
|
||||
|
||||
// adapt the actual version that's use by the artifacts
|
||||
// adapt the actual version used by the artifacts
|
||||
var snapshot_qualifier = snapshot_timestamp + "-" + snapshot_build_number;
|
||||
actual_version = info().version().withQualifier(snapshot_qualifier);
|
||||
|
||||
|
|
@ -161,7 +165,7 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
.info(info())
|
||||
.updated(moment)
|
||||
.build(),
|
||||
info().version() + "/" + repository.getMetadataName(), true);
|
||||
info().version() + "/" + repository.getMetadataName(), false);
|
||||
return actual_version;
|
||||
}
|
||||
|
||||
|
|
@ -181,7 +185,7 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
artifact_name.append('-').append(artifact.classifier());
|
||||
}
|
||||
var type = artifact.type();
|
||||
if (type == null || TYPE_JAR.equals(type) || TYPE_MODULAR_JAR.equals(type) || TYPE_CLASSPATH_JAR.equals(type)) {
|
||||
if (TYPE_JAR.equals(type) || TYPE_MODULAR_JAR.equals(type) || TYPE_CLASSPATH_JAR.equals(type)) {
|
||||
type = TYPE_JAR;
|
||||
}
|
||||
artifact_name.append('.').append(type);
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ public class Wrapper {
|
|||
public static final String WRAPPER_PROPERTIES = WRAPPER_PREFIX + ".properties";
|
||||
|
||||
static final String MAVEN_CENTRAL = "https://repo1.maven.org/maven2/";
|
||||
static final String SONATYPE_SNAPSHOTS = "https://s01.oss.sonatype.org/content/repositories/snapshots/";
|
||||
static final String CENTRAL_SNAPSHOTS = "https://central.sonatype.com/repository/maven-snapshots/";
|
||||
static final String DOWNLOAD_LOCATION = MAVEN_CENTRAL + "com/uwyn/rife2/bld/${version}/";
|
||||
static final String DOWNLOAD_LOCATION_SNAPSHOT = SONATYPE_SNAPSHOTS + "com/uwyn/rife2/bld/${version}/";
|
||||
static final String DOWNLOAD_LOCATION_SNAPSHOT = CENTRAL_SNAPSHOTS + "com/uwyn/rife2/bld/${version}/";
|
||||
static final String BLD_CACHE = "bld.cache";
|
||||
static final String BLD_FILENAME = "bld-${version}.jar";
|
||||
static final String BLD_SOURCES_FILENAME = "bld-${version}-sources.jar";
|
||||
|
|
|
|||
Loading…
Reference in a new issue