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

Add a classifier property to the Distribution type #18698

Closed
aalmiray opened this issue Oct 19, 2021 · 1 comment · Fixed by #18844
Closed

Add a classifier property to the Distribution type #18698

aalmiray opened this issue Oct 19, 2021 · 1 comment · Fixed by #18844
Assignees
Labels
a:feature A new functionality good first issue Good for newcomers in:distribution-plugin
Milestone

Comments

@aalmiray
Copy link
Contributor

Expected Behavior

Configure a custom distribution (using the distribution plugin) allowing the generated zip/tar files to have a classifier, such as

distributions {
    cli {
        distributionBaseName = project.name
        classifier =  "${osdetector.os}-${osdetector.arch}"
        contents {
            from("build/nativeImage") {
                into "bin"
                exclude "*.txt"
                rename "application", project.name
            }
            from(".") {
                include "LICENSE.txt"
            }
        }
    }
}

Current Behavior

There is no support for this. One must grab hold of the computed tasks names and append the classifier, such as

tasks.named("cliDistZip", Zip) {
    classifier =  "${osdetector.os}-${osdetector.arch}"
}

tasks.named("cliDistTar", Tar) {
    classifier =  "${osdetector.os}-${osdetector.arch}"
}

Context

I have the need to create platform specific distributions when working with projects that generate native executables with GraalVM Native Image.

@jimshowalter
Copy link

Upvote!

bot-gradle added a commit that referenced this issue Jun 17, 2022
…on type(fixes #18698)

Signed-off-by: Xin Wang <scaventz@outlook.com>

<!--- The issue this PR addresses -->
Fixes [#18698](#18698)

### Context
<!--- Why do you believe many users will benefit from this change? -->
<!--- Link to relevant issues or forum discussions here -->

### Contributor Checklist
- [x] [Review Contribution Guidelines](https://github.com/gradle/gradle/blob/master/CONTRIBUTING.md)
- [x] Make sure that all commits are [signed off](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff) to indicate that you agree to the terms of [Developer Certificate of Origin](https://developercertificate.org/).
- [x] Make sure all contributed code can be distributed under the terms of the [Apache License 2.0](https://github.com/gradle/gradle/blob/master/LICENSE), e.g. the code was written by yourself or the original code is licensed under [a license compatible to Apache License 2.0](https://apache.org/legal/resolved.html).
- [x] Check ["Allow edit from maintainers" option](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) in pull request so that additional changes can be pushed by Gradle team
- [x] Provide integration tests (under `<subproject>/src/integTest`) to verify changes from a user perspective
- [x] Provide unit tests (under `<subproject>/src/test`) to verify logic
- [x] Update User Guide, DSL Reference, and Javadoc for public-facing changes
- [x] Ensure that tests pass sanity check: `./gradlew sanityCheck`
- [x] Ensure that tests pass locally: `./gradlew <changed-subproject>:quickTest` (some tests failed, but seem not relavent)

### Gradle Core Team Checklist
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation
- [ ] Recognize contributor in release notes

Co-authored-by: Sergey Igushkin <sigushkin@gradle.com>
@bot-gradle bot-gradle added this to the 7.6 RC1 milestone Jun 17, 2022
@lptr lptr added good first issue Good for newcomers and removed 🌱 internal-onboarding Good issues to onboard new Gradle team members labels Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality good first issue Good for newcomers in:distribution-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants