Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
NX_BATCH_MODE=true
NX_VERBOSE_LOGGING=true
NX_CLOUD_VERBOSE_LOGGING=true
NX_TUI=false
CI=true
RUST_BACKTRACE=1
32 changes: 21 additions & 11 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ outputs:
runs:
using: composite
steps:
#- name: nx show project spring-boot-loader
#shell: bash
#run: npx nx show project spring-boot-loader --json --verbose
- name: Prepare Gradle Build
uses: ./.github/actions/prepare-gradle-build
with:
Expand All @@ -59,6 +62,13 @@ runs:
java-early-access: ${{ inputs.java-early-access }}
java-toolchain: ${{ inputs.java-toolchain }}
java-version: ${{ inputs.java-version }}
#- name: remove project graph
#shell: bash
#run: rm -f .nx/workspace-data/project-graph.json

- name: show projects
shell: bash
run: npx nx show project spring-boot-loader --json
- name: Build
id: build
if: ${{ inputs.publish == 'false' }}
Expand All @@ -68,17 +78,17 @@ runs:
COMMERCIAL_REPO_PASSWORD: ${{ inputs.commercial-repository-password }}
COMMERCIAL_REPO_USERNAME: ${{ inputs.commercial-repository-username }}
COMMERCIAL_SNAPSHOT_REPO_URL: ${{ inputs.commercial-snapshot-repository-url }}
run: ./gradlew build
- name: Publish
id: publish
if: ${{ inputs.publish == 'true' }}
shell: bash
env:
COMMERCIAL_RELEASE_REPO_URL: ${{ inputs.commercial-release-repository-url }}
COMMERCIAL_REPO_PASSWORD: ${{ inputs.commercial-repository-password }}
COMMERCIAL_REPO_USERNAME: ${{ inputs.commercial-repository-username }}
COMMERCIAL_SNAPSHOT_REPO_URL: ${{ inputs.commercial-snapshot-repository-url }}
run: ./gradlew -PdeploymentRepository=$(pwd)/deployment-repository ${{ !startsWith(github.event.head_commit.message, 'Next development version') && 'build' || '' }} publishAllPublicationsToDeploymentRepository
run: RUST_BACKTRACE=1 NX_FORCE_REUSE_CACHED_GRAPH=false CI=true NX_BATCH_MODE=true NX_CLOUD_DEREFERENCE_SYMLINKS=true NX_VERBOSE_LOGGING=true NX_PERF_LOGGING=true NX_CLOUD_NO_TIMEOUTS=true NX_CLOUD_VERBOSE_LOGGING=true npx nx run-many -t=build-ci --parallel=32 --batch --outputStyle=stream
# - name: Publish
# id: publish
# if: ${{ inputs.publish == 'true' }}
# shell: bash
# env:
# COMMERCIAL_RELEASE_REPO_URL: ${{ inputs.commercial-release-repository-url }}
# COMMERCIAL_REPO_PASSWORD: ${{ inputs.commercial-repository-password }}
# COMMERCIAL_REPO_USERNAME: ${{ inputs.commercial-repository-username }}
# COMMERCIAL_SNAPSHOT_REPO_URL: ${{ inputs.commercial-snapshot-repository-url }}
# run: ./gradlew -PdeploymentRepository=$(pwd)/deployment-repository ${{ !startsWith(github.event.head_commit.message, 'Next development version') && 'build' || '' }} publishAllPublicationsToDeploymentRepository
- name: Read Version From gradle.properties
id: read-version
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions .github/actions/prepare-gradle-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ runs:
if: ${{ inputs.cache-read-only == 'false' }}
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0
with:
cache-disabled: true
cache-read-only: false
develocity-access-key: ${{ inputs.develocity-access-key }}
- name: Set Up Gradle
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0
with:
cache-disabled: true
develocity-access-key: ${{ inputs.develocity-access-key }}
develocity-token-expiry: 4
- name: Configure Gradle Properties
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,41 @@ permissions:
jobs:
build:
name: Build Pull Request
if: ${{ github.repository == 'spring-projects/spring-boot' }}
runs-on: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
steps:
- name: Check Out Code
uses: actions/checkout@v4
# - name: Remove gradle cache folder
# run: rm -rf ~/.gradle/caches

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
check-latest: true
cache: npm
- run: npm install

# - run: npx nx reset
# - run: rm -f .nx/workspace-data/project-graph.json
# - run: ./gradlew nxProjectGraph -PciTestTargetName=ci --info --rerun-tasks --no-build-cache
# - run: npx nx show project spring-boot-loader --json --verbose

# This enables task distribution via Nx Cloud
# Run this command as early as possible, before dependencies are installed
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
# Uncomment this line to enable task distribution
- run: RUST_BACKTRACE=1 NX_FORCE_REUSE_CACHED_GRAPH=false NX_CLOUD_FORCE_USE_EXECUTE_TASKS_V3=false NX_CLOUD_DEREFERENCE_SYMLINKS=true NX_CLOUD_RETRIEVAL_CONCURRENCY=50 NX_CLOUD_NO_TIMEOUTS=true NX_VERBOSE_LOGGING=true NX_CLOUD_VERBOSE_LOGGING=true NX_PERF_LOGGING=true npx nx-cloud start-ci-run --require-explicit-completion --distribute-on="../../.nx/workflows/distribution-config.yaml"
- run: npx nx show project spring-boot-loader --json
- run: ./gradlew nxProjectGraph -PciTestTargetName=ci --info --rerun-tasks --no-build-cache
# - run: rm -f .nx/workspace-data/project-graph.json

- name: Build
id: build
uses: ./.github/actions/build
- name: Stop nx cloud agents
if: always()
run: npx nx-cloud complete-ci-run
- name: Print JVM Thread Dumps When Cancelled
if: cancelled()
uses: ./.github/actions/print-jvm-thread-dumps
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0
with:
cache-read-only: false
cache-disabled: true
- name: Configure Gradle Properties
shell: bash
run: |
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@ secrets.yml
.sts4-cache
.git-hooks/
node_modules

.nx/installation
.nx/cache
.nx/workspace-data

.specstory/**
.cursorindexingignore
.claude
116 changes: 116 additions & 0 deletions .nx/nxw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
"use strict";
// This file should be committed to your repository! It wraps Nx and ensures
// that your local installation matches nx.json.
// See: https://nx.dev/recipes/installation/install-non-javascript for more info.




Object.defineProperty(exports, "__esModule", { value: true });
const fs = require('fs');
const path = require('path');
const cp = require('child_process');
const installationPath = path.join(__dirname, 'installation', 'package.json');
function matchesCurrentNxInstall(currentInstallation, nxJsonInstallation) {
if (!currentInstallation.devDependencies ||
!Object.keys(currentInstallation.devDependencies).length) {
return false;
}
try {
if (currentInstallation.devDependencies['nx'] !==
nxJsonInstallation.version ||
require(path.join(path.dirname(installationPath), 'node_modules', 'nx', 'package.json')).version !== nxJsonInstallation.version) {
return false;
}
for (const [plugin, desiredVersion] of Object.entries(nxJsonInstallation.plugins || {})) {
if (currentInstallation.devDependencies[plugin] !== desiredVersion) {
return false;
}
}
return true;
}
catch {
return false;
}
}
function ensureDir(p) {
if (!fs.existsSync(p)) {
fs.mkdirSync(p, { recursive: true });
}
}
function getCurrentInstallation() {
try {
return require(installationPath);
}
catch {
return {
name: 'nx-installation',
version: '0.0.0',
devDependencies: {},
};
}
}
function performInstallation(currentInstallation, nxJson) {
fs.writeFileSync(installationPath, JSON.stringify({
name: 'nx-installation',
devDependencies: {
nx: nxJson.installation.version,
...nxJson.installation.plugins,
},
}));
try {
cp.execSync('npm i', {
cwd: path.dirname(installationPath),
stdio: 'inherit',
windowsHide: false,
});
}
catch (e) {
// revert possible changes to the current installation
fs.writeFileSync(installationPath, JSON.stringify(currentInstallation));
// rethrow
throw e;
}
}
function ensureUpToDateInstallation() {
const nxJsonPath = path.join(__dirname, '..', 'nx.json');
let nxJson;
try {
nxJson = require(nxJsonPath);
if (!nxJson.installation) {
console.error('[NX]: The "installation" entry in the "nx.json" file is required when running the nx wrapper. See https://nx.dev/recipes/installation/install-non-javascript');
process.exit(1);
}
}
catch {
console.error('[NX]: The "nx.json" file is required when running the nx wrapper. See https://nx.dev/recipes/installation/install-non-javascript');
process.exit(1);
}
try {
ensureDir(path.join(__dirname, 'installation'));
const currentInstallation = getCurrentInstallation();
if (!matchesCurrentNxInstall(currentInstallation, nxJson.installation)) {
performInstallation(currentInstallation, nxJson);
}
}
catch (e) {
const messageLines = [
'[NX]: Nx wrapper failed to synchronize installation.',
];
if (e instanceof Error) {
messageLines.push('');
messageLines.push(e.message);
messageLines.push(e.stack);
}
else {
messageLines.push(e.toString());
}
console.error(messageLines.join('\n'));
process.exit(1);
}
}
if (!process.env.NX_WRAPPER_SKIP_INSTALL) {
ensureUpToDateInstallation();
}

require('./installation/node_modules/nx/bin/nx');
58 changes: 58 additions & 0 deletions .nx/workflows/agents.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
launch-templates:
linux-extra-large-plus-jvm:
env:
NX_CLOUD_FORCE_USE_EXECUTE_TASKS_V3: "false"
DOCKER_HOST: ""
SERVICES_HOST: ""
LANG: C.UTF-8
resource-class: 'docker_linux_amd64/extra_large+'
image: 'ubuntu22.04-node20.11-v10'
init-steps:
- name: java version
script: java -version

- name: Checkout
uses: 'nrwl/nx-cloud-workflows/v3.6/workflow-steps/checkout/main.yaml'

- name: Setup Java 21
script: |
sudo apt update
sudo apt install -y openjdk-21-jdk
sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java
java -version
- name: Setup gradle
script: ./gradlew wrapper && ./gradlew --stop && ./gradlew clean

- name: Restore Node Modules Cache
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
inputs:
key: 'package-lock.json|yarn.lock|pnpm-lock.yaml'
paths: 'node_modules'
base-branch: 'main'
- name: Restore Browser Binary Cache
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
inputs:
key: 'package-lock.json|yarn.lock|pnpm-lock.yaml|"browsers"'
paths: |
'../.cache/Cypress'
base-branch: 'main'
- name: Install Node Modules
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/install-node-modules/main.yaml'

- name: run gradlew nxProjectGraph for all
script: ./gradlew nxProjectGraph -PciTestTargetName=ci --info --rerun-tasks --no-build-cache

- name: run gradlew nxProjectGraph
script: ./gradlew :spring-boot-project:spring-boot-tools:spring-boot-maven-plugin:nxProjectGraph -PciTestTargetName=ci --info

- name: Show projects
script: npx nx show projects

- name: show project spring-boot-buildpack-platform
script: npx nx show project spring-boot-buildpack-platform --json=false

- name: show project spring-boot-loader
script: npx nx show project spring-boot-loader --json=false

- name: show project spring-boot-loader json
script: npx nx show project spring-boot-loader --json
14 changes: 14 additions & 0 deletions .nx/workflows/distribution-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
distribute-on:
default: 5 linux-extra-large-plus-jvm

assignment-rules:
- targets:
- 'ciIntTest*'
run-on:
- agent: linux-extra-large-plus-jvm
parallelism: 1

- projects:
- "*"
run-on:
- agent: linux-extra-large-plus-jvm
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id "dev.nx.gradle.project-graph" version "0.0.1-alpha.9"
id "base"
id "org.jetbrains.kotlin.jvm" apply false // https://youtrack.jetbrains.com/issue/KT-30276
}
Expand All @@ -9,18 +10,21 @@ defaultTasks 'build'

allprojects {
group = "org.springframework.boot"
apply {
plugin("dev.nx.gradle.project-graph")
}
}

subprojects {
apply plugin: "org.springframework.boot.conventions"

repositories {
mavenLocal()
mavenCentral()
spring.mavenRepositories()
}

configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, "minutes"
}
}

}
Loading
Loading