-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9fbbc0
commit bbfaa9e
Showing
4 changed files
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
# Gradle properties | ||
Mods.groovy gives you access to Gradle properties in your `mods.groovy` file with the `buildProperties['propertyName']` syntax. | ||
This contains the properties from your gradle.properties file and any global ones, so you may want to blacklist them to | ||
avoid leaking private keys. | ||
Mods.groovy lets you expose project properties to your `mods.groovy` file, which can be accessed with the | ||
`buildProperties['propertyName']` syntax. This contains only properties you explicitly expose: | ||
```groovy | ||
modsDotGroovy.gather { | ||
projectProperty 'propertyName' | ||
} | ||
``` | ||
|
||
## Blacklisting | ||
By default, the Gradle plugin excludes properties whose name contains (case-insensitive): | ||
- pass | ||
- password | ||
- token | ||
- key | ||
- secret | ||
Note that `.gather` is shorthand for configuring the default generated gather tasks; a similar `.convert` shorthand exists | ||
for configuring the generated conversion tasks. | ||
|
||
You can change the blacklist with: | ||
## Version Catalogs | ||
Mods.groovy can capture version catalogs and exposes the values to the `mods.groovy` file; they are accessible through the | ||
`libs` property. By default, the `libs` version catalog is captured if it exists. To change which catalogs are captured, | ||
add to the `catalogs` property: | ||
```groovy | ||
modsDotGroovy { | ||
environmentBlacklist = ['private'] | ||
catalogs.add 'anotherVersionCatalog' | ||
} | ||
``` | ||
All captured version catalogs are merged and exposed in the same `libs` property. | ||
|
||
:::caution | ||
This overwrites the default blacklist, so you should copy over the words above if you want to add new entries | ||
rather than replace. | ||
::: | ||
## Environment Information | ||
The `environmentInfo` property exposes the raw information passed into the `mods.groovy` environment; in addition to the | ||
build property and version catalog information, a group and version (defaulting to the project group and version) are passed | ||
in as `environmentInfo.version` and `environmentInfo.group`. The group and version passed in can be configured on the | ||
conversion task: | ||
```groovy | ||
modsDotGroovy.convert { | ||
projectVersion.set '1.0.0' | ||
projectGroup.set 'org.example' | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
plugins { | ||
id 'org.groovymc.modsdotgroovy' version '2.0.0-beta.10' apply false | ||
id 'org.groovymc.modsdotgroovy' version '2.0.0-beta.21' apply false | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters