diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index bab5d67798..622a79e9bc 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -111,7 +111,7 @@ jobs: ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} - name: Sign Libraries with Developer ID - run: ./gradlew build -PbuildServer -PskipJavaFormat -PdeveloperID=${{ secrets.APPLE_DEVELOPER_ID }} ${{ matrix.build-options }} ${{ env.EXTRA_GRADLE_ARGS }} + run: ./gradlew copyAllOutputs --build-cache -PbuildServer -PskipJavaFormat -PdeveloperID=${{ secrets.APPLE_DEVELOPER_ID }} ${{ matrix.build-options }} ${{ env.EXTRA_GRADLE_ARGS }} if: | matrix.artifact-name == 'macOS' && (github.repository_owner == 'wpilibsuite' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))) diff --git a/build.gradle b/build.gradle index ad0eb6b067..29f578034c 100644 --- a/build.gradle +++ b/build.gradle @@ -136,8 +136,10 @@ subprojects { } // Sign outputs with Developer ID - if (project.hasProperty("developerID")) { - tasks.withType(AbstractLinkTask) { task -> + tasks.withType(AbstractLinkTask) { task -> + task.inputs.property "HasDeveloperId", project.hasProperty("developerID") + + if (project.hasProperty("developerID")) { // Don't sign any executables because codesign complains // about relative rpath. if (!(task instanceof LinkExecutable)) { diff --git a/datalogtool/publish.gradle b/datalogtool/publish.gradle index 9608bef7b6..e8228429fb 100644 --- a/datalogtool/publish.gradle +++ b/datalogtool/publish.gradle @@ -37,6 +37,8 @@ model { into("MacOS") { with copySpec { from binary.executable.file } } into("Resources") { with copySpec { from icon } } + inputs.property "HasDeveloperId", project.hasProperty("developerID") + doLast { if (project.hasProperty("developerID")) { // Get path to binary. diff --git a/glass/publish.gradle b/glass/publish.gradle index b127c11321..5e7cbaf7d5 100644 --- a/glass/publish.gradle +++ b/glass/publish.gradle @@ -92,6 +92,8 @@ model { into("MacOS") { with copySpec { from binary.executable.file } } into("Resources") { with copySpec { from icon } } + inputs.property "HasDeveloperId", project.hasProperty("developerID") + doLast { if (project.hasProperty("developerID")) { // Get path to binary. diff --git a/outlineviewer/publish.gradle b/outlineviewer/publish.gradle index 85bb26c69a..9c53ae5b60 100644 --- a/outlineviewer/publish.gradle +++ b/outlineviewer/publish.gradle @@ -37,6 +37,8 @@ model { into("MacOS") { with copySpec { from binary.executable.file } } into("Resources") { with copySpec { from icon } } + inputs.property "HasDeveloperId", project.hasProperty("developerID") + doLast { if (project.hasProperty("developerID")) { // Get path to binary. diff --git a/roborioteamnumbersetter/publish.gradle b/roborioteamnumbersetter/publish.gradle index 10b9de1d0f..da6a0f6d63 100644 --- a/roborioteamnumbersetter/publish.gradle +++ b/roborioteamnumbersetter/publish.gradle @@ -37,6 +37,8 @@ model { into("MacOS") { with copySpec { from binary.executable.file } } into("Resources") { with copySpec { from icon } } + inputs.property "HasDeveloperId", project.hasProperty("developerID") + doLast { if (project.hasProperty("developerID")) { // Get path to binary.