Giter VIP home page Giter VIP logo

Comments (6)

tha2015 avatar tha2015 commented on July 26, 2024 1

This feature should be supported in the next release v1.5.0. Specifically, extProperty config key will be able to be configured to expose the properties map under project.ext

from gradle-git-properties.

tha2015 avatar tha2015 commented on July 26, 2024 1

Closing because the feature is now available in v1.5.0
Please open new ticket for other requests. Thanks.

from gradle-git-properties.

tha2015 avatar tha2015 commented on July 26, 2024

Thanks for the suggestion. I'm thinking about exposing a Map as task output so the properties can be accessed as generateGitProperties.properties['git.commit.id.abbrev']

BTW because of the UP-TO-DATE check mechanism of Gradle, sometimes, the task will not be executed and so the Map would not be exposed, you will have to force task execution with

generateGitProperties.outputs.upToDateWhen { false }

And of course you will still need

dependsOn tasks.generateGitProperties

to make sure generateGitProperties to be executed before your logic

I'm also thinking about adding generateGitPropertiesFile config for the users who need the properties (but not the generated git.properties file). But it would complicate the way up-to-date check works for the plugin.

What do you think?

from gradle-git-properties.

brempusz avatar brempusz commented on July 26, 2024

I don't see any benefits in having just exposed properties without the file. Gained performance boost will be negligible but it will introduce more complicated code.

from gradle-git-properties.

sdavids avatar sdavids commented on July 26, 2024

Please also add a task to display all generated properties.

from gradle-git-properties.

tha2015 avatar tha2015 commented on July 26, 2024

@sdavids If it is for debugging purpose, I would suggest to use plugin version 1.5 with "--debug" option to display the generated map (see https://github.com/n0mer/gradle-git-properties/blob/master/src/main/groovy/com/gorylenko/GenerateGitPropertiesTask.groovy). If it is not for the debugging, why do you think the extProperty config will not sufficient for the job?

from gradle-git-properties.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.