From adb84e9c0529f80eb06a1cb835f3e2446c1235e5 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Wed, 23 Oct 2024 23:54:29 -0400 Subject: [PATCH 1/4] set skipNonDigest to true since Grails takes advantage of the manifest.properties file to properly map requests for non digested file names to the digested equivalent --- .../assetPipeline/templates/assetPipelineExtension.rocker.raw | 1 + .../grails/forge/feature/assetPipeline/AssetPipelineSpec.groovy | 2 ++ 2 files changed, 3 insertions(+) diff --git a/grails-forge-core/src/main/java/org/grails/forge/feature/assetPipeline/templates/assetPipelineExtension.rocker.raw b/grails-forge-core/src/main/java/org/grails/forge/feature/assetPipeline/templates/assetPipelineExtension.rocker.raw index 27bd22ca..24c22c8e 100644 --- a/grails-forge-core/src/main/java/org/grails/forge/feature/assetPipeline/templates/assetPipelineExtension.rocker.raw +++ b/grails-forge-core/src/main/java/org/grails/forge/feature/assetPipeline/templates/assetPipelineExtension.rocker.raw @@ -10,4 +10,5 @@ assets { } minifyJs = true minifyCss = true + skipNonDigests = true } \ No newline at end of file diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/assetPipeline/AssetPipelineSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/assetPipeline/AssetPipelineSpec.groovy index 8453a7b0..7b3414f5 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/assetPipeline/AssetPipelineSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/assetPipeline/AssetPipelineSpec.groovy @@ -45,6 +45,7 @@ class AssetPipelineSpec extends ApplicationContextSpec implements CommandOutputF assets { minifyJs = true minifyCss = true + skipNonDigests = true }''') } @@ -61,6 +62,7 @@ assets { packagePlugin = true minifyJs = true minifyCss = true + skipNonDigests = true }''') where: applicationType << [ApplicationType.WEB_PLUGIN] From e5fa7641d3e27a4d2f1423f242e2a1cd27d66a2f Mon Sep 17 00:00:00 2001 From: James Fredley Date: Thu, 24 Oct 2024 00:00:59 -0400 Subject: [PATCH 2/4] re-trigger workflow --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 35b6ca68..47d5278a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,4 +24,4 @@ jobs: run: | gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-latest --image $IMAGE_NAME --region us-central1 --update-env-vars=HOSTNAME="grailsforge-latest-cjmq3uyfcq-uc.a.run.app",CORS_ALLOWED_ORIGIN="https://start.grails.org",GITHUB_OAUTH_APP_CLIENT_ID=${{ secrets.GH_OAUTH_LATEST_CLIENT_ID }},GITHUB_OAUTH_APP_CLIENT_SECRET=${{ secrets.GH_OAUTH_LATEST_CLIENT_SECRET }},GITHUB_USER_AGENT=${{ secrets.GH_USER_AGENT }},GITHUB_REDIRECT_URL=${{ secrets.GH_REDIRECT_URL }} --platform managed --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }} version="$(echo "${release_version//./}" | tr '[A-Z]' '[a-z]')" - gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-$version --image $IMAGE_NAME --region us-central1 --update-env-vars=HOSTNAME="grailsforge-600-cjmq3uyfcq-uc.a.run.app",CORS_ALLOWED_ORIGIN="https://start.grails.org",GITHUB_OAUTH_APP_CLIENT_ID=${{ secrets.GH_OAUTH_LATEST_CLIENT_ID }},GITHUB_OAUTH_APP_CLIENT_SECRET=${{ secrets.GH_OAUTH_LATEST_CLIENT_SECRET }},GITHUB_USER_AGENT=${{ secrets.GH_USER_AGENT }},GITHUB_REDIRECT_URL=${{ secrets.GH_REDIRECT_URL }} --platform managed --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }} \ No newline at end of file + gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-$version --image $IMAGE_NAME --region us-central1 --update-env-vars=HOSTNAME="grailsforge-600-cjmq3uyfcq-uc.a.run.app",CORS_ALLOWED_ORIGIN="https://start.grails.org",GITHUB_OAUTH_APP_CLIENT_ID=${{ secrets.GH_OAUTH_LATEST_CLIENT_ID }},GITHUB_OAUTH_APP_CLIENT_SECRET=${{ secrets.GH_OAUTH_LATEST_CLIENT_SECRET }},GITHUB_USER_AGENT=${{ secrets.GH_USER_AGENT }},GITHUB_REDIRECT_URL=${{ secrets.GH_REDIRECT_URL }} --platform managed --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }} From 6718be300dd82c98c5cb2e491871f7168decbc75 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Thu, 24 Oct 2024 00:02:26 -0400 Subject: [PATCH 3/4] Revert "re-trigger workflow" This reverts commit e5fa7641d3e27a4d2f1423f242e2a1cd27d66a2f. --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 47d5278a..35b6ca68 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,4 +24,4 @@ jobs: run: | gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-latest --image $IMAGE_NAME --region us-central1 --update-env-vars=HOSTNAME="grailsforge-latest-cjmq3uyfcq-uc.a.run.app",CORS_ALLOWED_ORIGIN="https://start.grails.org",GITHUB_OAUTH_APP_CLIENT_ID=${{ secrets.GH_OAUTH_LATEST_CLIENT_ID }},GITHUB_OAUTH_APP_CLIENT_SECRET=${{ secrets.GH_OAUTH_LATEST_CLIENT_SECRET }},GITHUB_USER_AGENT=${{ secrets.GH_USER_AGENT }},GITHUB_REDIRECT_URL=${{ secrets.GH_REDIRECT_URL }} --platform managed --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }} version="$(echo "${release_version//./}" | tr '[A-Z]' '[a-z]')" - gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-$version --image $IMAGE_NAME --region us-central1 --update-env-vars=HOSTNAME="grailsforge-600-cjmq3uyfcq-uc.a.run.app",CORS_ALLOWED_ORIGIN="https://start.grails.org",GITHUB_OAUTH_APP_CLIENT_ID=${{ secrets.GH_OAUTH_LATEST_CLIENT_ID }},GITHUB_OAUTH_APP_CLIENT_SECRET=${{ secrets.GH_OAUTH_LATEST_CLIENT_SECRET }},GITHUB_USER_AGENT=${{ secrets.GH_USER_AGENT }},GITHUB_REDIRECT_URL=${{ secrets.GH_REDIRECT_URL }} --platform managed --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }} + gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-$version --image $IMAGE_NAME --region us-central1 --update-env-vars=HOSTNAME="grailsforge-600-cjmq3uyfcq-uc.a.run.app",CORS_ALLOWED_ORIGIN="https://start.grails.org",GITHUB_OAUTH_APP_CLIENT_ID=${{ secrets.GH_OAUTH_LATEST_CLIENT_ID }},GITHUB_OAUTH_APP_CLIENT_SECRET=${{ secrets.GH_OAUTH_LATEST_CLIENT_SECRET }},GITHUB_USER_AGENT=${{ secrets.GH_USER_AGENT }},GITHUB_REDIRECT_URL=${{ secrets.GH_REDIRECT_URL }} --platform managed --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }} \ No newline at end of file From 1d4a33c265927051d0e49abbe236f2aa5f29210a Mon Sep 17 00:00:00 2001 From: James Fredley Date: Thu, 31 Oct 2024 14:34:54 -0400 Subject: [PATCH 4/4] make grails-wrapper a default feature --- .../feature/grailsWrapper/GrailsWrapper.java | 20 +++++++++- .../grailsWrapper/GrailsWrapperFeature.java | 38 ------------------- .../grailsWrapper/GrailsWrapperSpec.groovy | 2 +- 3 files changed, 19 insertions(+), 41 deletions(-) delete mode 100644 grails-forge-core/src/main/java/org/grails/forge/feature/grailsWrapper/GrailsWrapperFeature.java diff --git a/grails-forge-core/src/main/java/org/grails/forge/feature/grailsWrapper/GrailsWrapper.java b/grails-forge-core/src/main/java/org/grails/forge/feature/grailsWrapper/GrailsWrapper.java index 60b7e7ff..a78c3161 100644 --- a/grails-forge-core/src/main/java/org/grails/forge/feature/grailsWrapper/GrailsWrapper.java +++ b/grails-forge-core/src/main/java/org/grails/forge/feature/grailsWrapper/GrailsWrapper.java @@ -19,10 +19,21 @@ import org.grails.forge.application.ApplicationType; import org.grails.forge.application.OperatingSystem; import org.grails.forge.application.generator.GeneratorContext; +import org.grails.forge.feature.Category; +import org.grails.forge.feature.DefaultFeature; +import org.grails.forge.feature.Feature; +import org.grails.forge.options.Options; import org.grails.forge.template.BinaryTemplate; +import java.util.Set; + @Singleton -public class GrailsWrapper implements GrailsWrapperFeature { +public class GrailsWrapper implements DefaultFeature { + + @Override + public boolean shouldApply(ApplicationType applicationType, Options options, Set selectedFeatures) { + return true; + } @Override public String getName() { @@ -41,7 +52,7 @@ public String getDescription() { @Override public boolean isVisible() { - return true; + return false; } @Override @@ -59,4 +70,9 @@ public void apply(GeneratorContext generatorContext) { public boolean supports(ApplicationType applicationType) { return true; } + + @Override + public String getCategory() { + return Category.DEV_TOOLS; + } } diff --git a/grails-forge-core/src/main/java/org/grails/forge/feature/grailsWrapper/GrailsWrapperFeature.java b/grails-forge-core/src/main/java/org/grails/forge/feature/grailsWrapper/GrailsWrapperFeature.java deleted file mode 100644 index 965c8f98..00000000 --- a/grails-forge-core/src/main/java/org/grails/forge/feature/grailsWrapper/GrailsWrapperFeature.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2017-2024 original authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.grails.forge.feature.grailsWrapper; - -import org.grails.forge.application.ApplicationType; -import org.grails.forge.feature.Category; -import org.grails.forge.feature.OneOfFeature; - -public interface GrailsWrapperFeature extends OneOfFeature { - - @Override - default Class getFeatureClass() { - return GrailsWrapperFeature.class; - } - - @Override - default boolean supports(ApplicationType applicationType) { - return true; - } - - @Override - default String getCategory() { - return Category.DEV_TOOLS; - } -} diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grailsWrapper/GrailsWrapperSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grailsWrapper/GrailsWrapperSpec.groovy index 5dbd6f1e..65a740aa 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grailsWrapper/GrailsWrapperSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grailsWrapper/GrailsWrapperSpec.groovy @@ -13,7 +13,7 @@ class GrailsWrapperSpec extends ApplicationContextSpec implements CommandOutputF @Unroll void "test grails-wrapper.jar, grailsw and grailsw.bat files are present for #applicationType application"() { when: - def output = generate(applicationType, new Options(TestFramework.SPOCK, JdkVersion.JDK_11), ['grails-wrapper']) + def output = generate(applicationType, new Options(TestFramework.SPOCK, JdkVersion.JDK_11)) then: output.containsKey("grails-wrapper.jar")