Skip to content

Commit

Permalink
chore: Build spoon manually so jbang finds an artifact in local repos…
Browse files Browse the repository at this point in the history
…itory
  • Loading branch information
I-Al-Istannen committed Apr 3, 2024
1 parent f9dd782 commit ddfb82c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Expand Up @@ -120,7 +120,7 @@ jobs:
- name: Time nix setup
run: nix develop ${{ env.NIX_OPTIONS }} .#extraChecks --command true
- name: Run Javadoc quality check
run: nix develop ${{ env.NIX_OPTIONS }} .#extraChecks --command javadoc-quality
run: nix develop ${{ env.NIX_OPTIONS }} .#extraChecks --command ci-javadoc-quality

reproducible-builds:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions chore/check-javadoc-regressions.py
Expand Up @@ -80,8 +80,8 @@ def run_quality_check(config_path: Path, target_branch: Optional[str] = None) ->
it does not exist locally.
"""
check_path = Path("chore/CheckJavadoc.java")
if target_branch and not check_path.exists():
print(warn(f"Quality check does not exist in file system, borrowing it from '{target_branch}'"))
if target_branch:
print(warn(f"Borrowing quality script from '{target_branch}'"))
run_command(["git", "checkout", target_branch, "--", str(check_path)])

return run_command([
Expand Down
18 changes: 17 additions & 1 deletion flake.nix
Expand Up @@ -168,6 +168,22 @@
reproducibleBuilds = pkgs.writeScriptBin "reproducible-builds" ''
chore/check-reproducible-builds.sh
'';
ciJavadocQuality = pkgs.writeScriptBin "ci-javadoc-quality" ''
# Help jbang. Build locally and update the version. Otherwise it fails to resolve sometimes.
pushd spoon-pom || exit 1
mvn clean install -Dmaven.test.skip=true -DskipDepClean &>/dev/null
popd || exit 2
# Use concrete version
sed -i "s/:RELEASE/:$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)/" chore/CheckJavadoc.java
git add chore/CheckJavadoc.java
git config user.email "jbang-fixup@example.com"
git config user.name "Jbang fixup"
git commit -m "Fixup version"
# Delegate
javadoc-quality
'';
javadocQuality = pkgs.writeScriptBin "javadoc-quality" ''
./chore/check-javadoc-regressions.py COMPARE_WITH_MASTER
'';
Expand All @@ -180,7 +196,7 @@
])
else [ ];
packages = with pkgs;
[ jdk maven test codegen coverage mavenPomQuality javadocQuality reproducibleBuilds ]
[ jdk maven test codegen coverage mavenPomQuality javadocQuality ciJavadocQuality reproducibleBuilds ]
++ (if extraChecks then [ gradle pythonEnv extra extraRemote jbang ] else [ ])
++ (if release then [ semver jreleaser ] else [ ]);
};
Expand Down

0 comments on commit ddfb82c

Please sign in to comment.