mirror of
https://github.com/rife2/bld
synced 2026-08-05 07:07:48 +02:00
Compare commits
4 commits
6becca25b4
...
54b2b4d305
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54b2b4d305 | ||
|
|
b31072d8b4 | ||
|
|
32680566c2 | ||
|
|
d7142fa5c8 |
24
.github/workflows/bld.yml
vendored
24
.github/workflows/bld.yml
vendored
|
|
@ -107,6 +107,14 @@ jobs:
|
||||||
java-version: ${{ matrix.java-version }}
|
java-version: ${{ matrix.java-version }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Cache bld dependencies
|
||||||
|
id: cache-bld
|
||||||
|
uses: actions/cache@v5
|
||||||
|
with:
|
||||||
|
path: lib
|
||||||
|
key: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
|
||||||
|
restore-keys: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Download dependencies
|
||||||
run: ./bld clean download
|
run: ./bld clean download
|
||||||
|
|
||||||
|
|
@ -148,6 +156,14 @@ jobs:
|
||||||
java-version: ${{ matrix.java-version }}
|
java-version: ${{ matrix.java-version }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Cache bld dependencies
|
||||||
|
id: cache-bld
|
||||||
|
uses: actions/cache@v5
|
||||||
|
with:
|
||||||
|
path: lib
|
||||||
|
key: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
|
||||||
|
restore-keys: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Download dependencies
|
||||||
run: ./bld clean download
|
run: ./bld clean download
|
||||||
|
|
||||||
|
|
@ -187,6 +203,14 @@ jobs:
|
||||||
java-version: ${{ matrix.java-version }}
|
java-version: ${{ matrix.java-version }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Cache bld dependencies
|
||||||
|
id: cache-bld
|
||||||
|
uses: actions/cache@v5
|
||||||
|
with:
|
||||||
|
path: lib
|
||||||
|
key: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
|
||||||
|
restore-keys: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Download dependencies
|
||||||
run: .\bld.bat clean download
|
run: .\bld.bat clean download
|
||||||
|
|
||||||
|
|
|
||||||
1
.github/workflows/pages.yml
vendored
1
.github/workflows/pages.yml
vendored
|
|
@ -22,6 +22,7 @@ concurrency:
|
||||||
jobs:
|
jobs:
|
||||||
# Single deploy job since we're just deploying
|
# Single deploy job since we're just deploying
|
||||||
deploy:
|
deploy:
|
||||||
|
if: github.repository == 'rife2/bld'
|
||||||
environment:
|
environment:
|
||||||
name: github-pages
|
name: github-pages
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
|
|
||||||
49
.github/workflows/publish.yml
vendored
Normal file
49
.github/workflows/publish.yml
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
name: publish-snapshots
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-bld-project:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout source repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Check version is SNAPSHOT
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
VERSION=$(tr -d '[:space:]' < src/main/resources/BLD_VERSION)
|
||||||
|
echo "Current version: $VERSION"
|
||||||
|
if ! echo "$VERSION" | grep -q 'SNAPSHOT$'; then
|
||||||
|
echo "::error:: Version '$VERSION' is not a SNAPSHOT. Aborting publish."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Set up JDK
|
||||||
|
uses: actions/setup-java@v5
|
||||||
|
with:
|
||||||
|
distribution: "temurin"
|
||||||
|
java-version: 17
|
||||||
|
|
||||||
|
- name: Download dependencies
|
||||||
|
run: ./bld download
|
||||||
|
|
||||||
|
- name: Import key
|
||||||
|
run: echo "${{ secrets.SIGN_SECRET_KEY }}" | gpg --batch --import
|
||||||
|
|
||||||
|
- name: Publish
|
||||||
|
run: >-
|
||||||
|
./bld compile test publish
|
||||||
|
-Drife2Username=${{ secrets.RIFE2_USERNAME }}
|
||||||
|
-Drife2Password=${{ secrets.RIFE2_PASSWORD }}
|
||||||
|
-DsonatypeUser=${{ secrets.SONATYPE_USER }}
|
||||||
|
-DsonatypePassword=${{ secrets.SONATYPE_PASSWORD }}
|
||||||
|
-DsignKey=${{ secrets.SIGN_KEY }}
|
||||||
|
-DsignPassphrase=${{ secrets.SIGN_PASSPHRASE }}
|
||||||
|
|
||||||
|
- name: Delete GnuPG data
|
||||||
|
run: rm -rfv $HOME/.gnupg
|
||||||
27
.github/workflows/purge-cache.yml
vendored
Normal file
27
.github/workflows/purge-cache.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
name: purge-cache
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
confirm:
|
||||||
|
description: 'Type "yes" to confirm purging all bld caches'
|
||||||
|
required: true
|
||||||
|
default: 'no'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
clear-cache:
|
||||||
|
if: github.event.inputs.confirm == 'yes'
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
permissions:
|
||||||
|
actions: write
|
||||||
|
steps:
|
||||||
|
- name: Purge bld caches for ${{ runner.os }}
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
echo "Purging all caches with key ${{ runner.os }}-bld-"
|
||||||
|
gh cache delete --all --key "${{ runner.os }}-bld-"
|
||||||
|
echo "Done for ${{ runner.os }}"
|
||||||
|
|
@ -3,10 +3,10 @@ bld.downloadExtensionSources=true
|
||||||
bld.downloadLocation=
|
bld.downloadLocation=
|
||||||
bld.extension-antlr=com.uwyn.rife2:bld-antlr4:1.4.3
|
bld.extension-antlr=com.uwyn.rife2:bld-antlr4:1.4.3
|
||||||
bld.extension-archive=com.uwyn.rife2:bld-archive:0.6.3
|
bld.extension-archive=com.uwyn.rife2:bld-archive:0.6.3
|
||||||
bld.extension-reporter=com.uwyn.rife2:bld-junit-reporter:0.9.2
|
bld.extension-reporter=com.uwyn.rife2:bld-junit-reporter:1.2.0-SNAPSHOT
|
||||||
bld.extension-tests=com.uwyn.rife2:bld-tests-badge:1.6.3
|
bld.extension-tests=com.uwyn.rife2:bld-tests-badge:1.6.3
|
||||||
bld.javaOptions=
|
bld.javaOptions=
|
||||||
bld.javacOptions=
|
bld.javacOptions=
|
||||||
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES
|
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES,RIFE2_SNAPSHOTS
|
||||||
bld.sourceDirectories=core/src/bld/java
|
bld.sourceDirectories=core/src/bld/java
|
||||||
bld.version=2.3.0
|
bld.version=2.3.1-SNAPSHOT
|
||||||
|
|
@ -534,7 +534,22 @@ public class BaseProject extends BuildExecutor {
|
||||||
@BuildCommand(help = DownloadHelp.class)
|
@BuildCommand(help = DownloadHelp.class)
|
||||||
public void download()
|
public void download()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
downloadOperation().executeOnce(() -> downloadOperation().fromProject(this));
|
var auto = false;
|
||||||
|
var arguments = this.arguments();
|
||||||
|
while (!arguments.isEmpty()) {
|
||||||
|
var argument = arguments.get(0);
|
||||||
|
if (DownloadOperation.AUTO_OPTION.equals(argument)) {
|
||||||
|
arguments.remove(0);
|
||||||
|
auto = true;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (auto) {
|
||||||
|
performAutoDownloadPurge();
|
||||||
|
} else {
|
||||||
|
downloadOperation().executeOnce(() -> downloadOperation().fromProject(this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ public record Repository(String location, String username, String password) {
|
||||||
public static Repository MAVEN_LOCAL = null;
|
public static Repository MAVEN_LOCAL = null;
|
||||||
public static final Repository APACHE = new Repository("https://repo.maven.apache.org/maven2/");
|
public static final Repository APACHE = new Repository("https://repo.maven.apache.org/maven2/");
|
||||||
public static final Repository GOOGLE = new Repository("https://maven.google.com/");
|
public static final Repository GOOGLE = new Repository("https://maven.google.com/");
|
||||||
|
public static final Repository GOOGLE_MAVEN_CENTRAL = new Repository("https://maven-central.storage-download.googleapis.com/maven2/");
|
||||||
|
public static final Repository GOOGLE_MAVEN_CENTRAL_EU = new Repository("https://maven-central-eu.storage-download.googleapis.com/maven2/");
|
||||||
|
public static final Repository GOOGLE_MAVEN_CENTRAL_ASIA = new Repository("https://maven-central-asia.storage-download.googleapis.com/maven2/");
|
||||||
public static final Repository MAVEN_CENTRAL = new Repository("https://repo1.maven.org/maven2/");
|
public static final Repository MAVEN_CENTRAL = new Repository("https://repo1.maven.org/maven2/");
|
||||||
public static final Repository SECURECHAIN_REBUILT = new Repository("https://nexus-repo.corp.cloudlinux.com/repository/tuxcare_rebuilt");
|
public static final Repository SECURECHAIN_REBUILT = new Repository("https://nexus-repo.corp.cloudlinux.com/repository/tuxcare_rebuilt");
|
||||||
public static final Repository SECURECHAIN_VETTED = new Repository("https://nexus-repo.corp.cloudlinux.com/repository/tuxcare_vetted");
|
public static final Repository SECURECHAIN_VETTED = new Repository("https://nexus-repo.corp.cloudlinux.com/repository/tuxcare_vetted");
|
||||||
|
|
@ -91,6 +94,9 @@ public record Repository(String location, String username, String password) {
|
||||||
return switch (locationOrName) {
|
return switch (locationOrName) {
|
||||||
case "APACHE" -> Repository.APACHE;
|
case "APACHE" -> Repository.APACHE;
|
||||||
case "GOOGLE" -> Repository.GOOGLE;
|
case "GOOGLE" -> Repository.GOOGLE;
|
||||||
|
case "GOOGLE_MAVEN_CENTRAL" -> Repository.GOOGLE_MAVEN_CENTRAL;
|
||||||
|
case "GOOGLE_MAVEN_CENTRAL_EU" -> Repository.GOOGLE_MAVEN_CENTRAL_EU;
|
||||||
|
case "GOOGLE_MAVEN_CENTRAL_ASIA" -> Repository.GOOGLE_MAVEN_CENTRAL_ASIA;
|
||||||
case "MAVEN_CENTRAL" -> Repository.MAVEN_CENTRAL;
|
case "MAVEN_CENTRAL" -> Repository.MAVEN_CENTRAL;
|
||||||
case "MAVEN_LOCAL" -> Repository.MAVEN_LOCAL;
|
case "MAVEN_LOCAL" -> Repository.MAVEN_LOCAL;
|
||||||
case "RIFE2_RELEASES" -> Repository.RIFE2_RELEASES;
|
case "RIFE2_RELEASES" -> Repository.RIFE2_RELEASES;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
package rife.bld.help;
|
package rife.bld.help;
|
||||||
|
|
||||||
import rife.bld.CommandHelp;
|
import rife.bld.CommandHelp;
|
||||||
import rife.tools.StringUtils;
|
import rife.bld.operations.DownloadOperation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides help for the download command.
|
* Provides help for the download command.
|
||||||
|
|
@ -15,13 +15,13 @@ import rife.tools.StringUtils;
|
||||||
*/
|
*/
|
||||||
public class DownloadHelp implements CommandHelp {
|
public class DownloadHelp implements CommandHelp {
|
||||||
public String getSummary() {
|
public String getSummary() {
|
||||||
return "Downloads all dependencies of the project";
|
return "Downloads all dependencies of the project (take option)";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription(String topic) {
|
public String getDescription(String topic) {
|
||||||
return StringUtils.replace("""
|
return String.format("""
|
||||||
Downloads all dependencies of the project
|
Downloads all dependencies of the project
|
||||||
|
|
||||||
Usage : ${topic}""", "${topic}", topic);
|
Usage : %s [%s]""", topic, DownloadOperation.AUTO_OPTION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -25,6 +25,7 @@ import static rife.bld.dependencies.Dependency.CLASSIFIER_SOURCES;
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
||||||
|
public static final String AUTO_OPTION = "--auto";
|
||||||
private boolean offline_ = false;
|
private boolean offline_ = false;
|
||||||
private HierarchicalProperties properties_ = null;
|
private HierarchicalProperties properties_ = null;
|
||||||
private ArtifactRetriever retriever_ = null;
|
private ArtifactRetriever retriever_ = null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue