Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hendrix-shen/replace-token
A gradle to replace token in class file.
https://github.com/hendrix-shen/replace-token
Last synced: 5 days ago
JSON representation
A gradle to replace token in class file.
- Host: GitHub
- URL: https://github.com/hendrix-shen/replace-token
- Owner: Hendrix-Shen
- License: lgpl-3.0
- Created: 2024-05-04T13:48:56.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-09-11T10:04:17.000Z (4 months ago)
- Last Synced: 2024-09-11T14:24:59.032Z (4 months ago)
- Language: Java
- Size: 96.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## replace-token
[![JitPack](https://img.shields.io/jitpack/version/com.github.hendrix-shen/replace-token?style=flat-square)](https://jitpack.io/#Hendrix-Shen/replace-token)
[![Gradle Plugin Portal Version](https://img.shields.io/gradle-plugin-portal/v/top.hendrixshen.replace-token?style=flat-square)](https://plugins.gradle.org/plugin/top.hendrixshen.replace-token)A gradle to replace token in class file.
### Usages
#### 1. Apply
Since version `1.1.1`, replace-token is available in the [gradle plugin portal](https://plugins.gradle.org/plugin/top.hendrixshen.replace-token):
```groovy
// settings.gradle
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
```Now you can apply the plugin to your project:
```groovy
// build.gradle
plugins {
id("top.hendrixshen.replace-token").version("1.1.2")
}
```#### 2. Configure
```groovy
// build.gradle
replaceToken {
// Set sourceSets
targetSourceSets.set([sourceSets.main])
// Global token
replace("foo", "bar")
// If not specified, all classes are processed by default.
replaceIn("com/example1/Main")
// Local token
replace("foo", "bar", "com/example2/Main")
// Inner class example
replace("foo", "bar", "com/example3/Main\$Inner")
}
```#### 3. Done
That's it, everything is done
### License
This project is available under the LGPLv3 license. Feel free to learn from it and incorporate it in your own projects.