Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove -plain suffix from Grails Plugin artifacts #347

Merged
merged 2 commits into from
Nov 4, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2015 original authors
* Copyright 2015-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
*
* http://www.apache.org/licenses/LICENSE-2.0
* 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,
Expand Down Expand Up @@ -36,6 +36,7 @@ import org.gradle.api.tasks.compile.GroovyCompile
import org.gradle.language.jvm.tasks.ProcessResources
import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry
import org.grails.gradle.plugin.util.SourceSets
import org.springframework.boot.gradle.plugin.SpringBootPlugin
import org.springframework.boot.gradle.tasks.bundling.BootJar

import javax.inject.Inject
Expand Down Expand Up @@ -186,13 +187,14 @@ class GrailsPluginGradlePlugin extends GrailsGradlePlugin {
}

protected void configurePluginJarTask(Project project) {
Jar jarTask = (Jar)project.tasks.findByName('jar')
// re-enable, since Boot disable this
project.getTasks().getByName(JavaPlugin.JAR_TASK_NAME).setEnabled(true)
jarTask.exclude "application.yml"
jarTask.exclude "application.groovy"
jarTask.exclude "logback.groovy"
jarTask.exclude "logback.xml"
project.tasks.named(SpringBootPlugin.BOOT_JAR_TASK_NAME) {
it.enabled = false // Grails Plugins should not produce a bootJar
}
project.tasks.named(JavaPlugin.JAR_TASK_NAME, Jar) {
it.enabled = true
it.archiveClassifier.set('') // Remove '-plain' suffix from jar file name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this will impact any grails plugin (which is probably a very good thing) - @jamesfredley started a google document to gather upgrade gotchas. @codeconsole moved that document to here: https://github.com/grails/grails-core/blob/7.0.x/UPGRADE7.md Can you add a bullet point documenting this change for plugin authors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this will impact any grails plugin

Yes, any project that applies the org.grails.grails-plugin gradle plugin will be impacted.

Can you add a bullet point documenting this change for plugin authors?

Here is an PR for the Grails 7 gotchas: grails/grails-core#13825

it.exclude('application.yml', 'application.groovy', 'logback.groovy', 'logback.xml')
}
}

@CompileDynamic
Expand Down
Loading