Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ The Gradle plugin generates per-function ProGuard / R8 `-assumevalues` rules for
The task runs automatically when you build a release variant. To run it manually:

```bash
./gradlew :app:generateProguardRules
./gradlew :app:generateFeaturedProguardRules
```

Output: `app/build/featured/proguard-featured.pro`
Expand Down Expand Up @@ -490,7 +490,7 @@ Run code generation tasks across all modules at once:
./gradlew scanAllLocalFlags

# Generate R8 rules for all Android modules
./gradlew generateProguardRules
./gradlew generateFeaturedProguardRules

# Generate xcconfig across all modules
./gradlew generateXcconfig
Expand All @@ -502,7 +502,7 @@ Declare a single shared `ConfigValues` in your app module and inject it into fea

## Configuration cache

`featured-gradle-plugin` officially supports the Gradle [Configuration Cache](https://docs.gradle.org/current/userguide/configuration_cache.html) on **Gradle 9+** and **AGP 9+**. Every task registered by the plugin (`resolveFeatureFlags`, `generateProguardRules`, `generateConfigParam`, `generateFlagRegistrar`, `generateIosConstVal`, `generateXcconfig`) stores and reuses CC entries without violations.
`featured-gradle-plugin` officially supports the Gradle [Configuration Cache](https://docs.gradle.org/current/userguide/configuration_cache.html) on **Gradle 9+** and **AGP 9+**. Every task registered by the plugin (`resolveFeatureFlags`, `generateFeaturedProguardRules`, `generateConfigParam`, `generateFlagRegistrar`, `generateIosConstVal`, `generateXcconfig`, `scanAllLocalFlags`) stores and reuses CC entries without violations.

### Enabling

Expand Down
2 changes: 1 addition & 1 deletion docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ The plugin generates:
| `resolveFeatureFlags` | Resolves DSL-declared flags; runs before all code-generation tasks |
| `generateConfigParam` | Generates `GeneratedLocalFlags` and `GeneratedRemoteFlags` objects |
| `generateFlagRegistrar` | Generates flag registrar for the debug UI |
| `generateProguardRules` | Generates per-function R8 `-assumevalues` rules for local boolean flags |
| `generateFeaturedProguardRules` | Generates per-function R8 `-assumevalues` rules for local boolean flags |
| `generateIosConstVal` | Generates `expect`/`actual const val` for local flags (iOS) |
| `generateXcconfig` | Generates xcconfig with `DISABLE_*` conditions for local boolean flags |
| `scanAllLocalFlags` | Aggregator task — collects flags across all modules |
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ For the full release history with diff links, see the

_Changes on `main` not yet tagged for release._

### Changed
- Renamed the Gradle ProGuard/R8 generation task from `generateProguardRules` to
`generateFeaturedProguardRules` to avoid task-name clashes with consumer scripts.
Migration: update any CI/build scripts that invoke `generateProguardRules` to use
the new name. The old task name is no longer registered. (#190)

---

## Contributing a changelog entry
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ The Gradle plugin generates per-function `-assumevalues` rules for the generated
The task runs automatically when you build a release variant. To run it manually:

```bash
./gradlew :app:generateProguardRules
./gradlew :app:generateFeaturedProguardRules
```

Output: `app/build/featured/proguard-featured.pro`
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Once the feature is fully rolled out and validated:
4. Regenerate platform artefacts:

```bash
./gradlew generateProguardRules # keep Android R8 rules in sync
./gradlew generateFeaturedProguardRules # keep Android R8 rules in sync
./gradlew generateXcconfig # keep iOS xcconfig in sync
```

Expand Down
2 changes: 1 addition & 1 deletion featured-gradle-plugin/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ featured {
| `resolveFeatureFlags` | `build/featured/flags.txt` |
| `generateConfigParam` | `build/generated/featured/commonMain/Generated{Local,Remote}Flags.kt` + `GeneratedFlagExtensions.kt` |
| `generateFlagRegistrar` | `build/generated/featured/GeneratedFlagRegistrar.kt` |
| `generateProguardRules` | `build/featured/proguard-featured.pro` |
| `generateFeaturedProguardRules` | `build/featured/proguard-featured.pro` |
| `generateIosConstVal` | iOS constant value files |
| `generateXcconfig` | `build/featured/FeatureFlags.generated.xcconfig` |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.gradle.api.tasks.TaskProvider
internal const val RESOLVE_FLAGS_TASK_NAME = "resolveFeatureFlags"
internal const val SCAN_ALL_TASK_NAME = "scanAllLocalFlags"
internal const val GENERATE_FLAG_REGISTRAR_TASK_NAME = "generateFlagRegistrar"
internal const val GENERATE_PROGUARD_TASK_NAME = "generateProguardRules"
internal const val GENERATE_PROGUARD_TASK_NAME = "generateFeaturedProguardRules"
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
Comment thread
kirich1409 marked this conversation as resolved.
internal const val GENERATE_IOS_CONST_VAL_TASK_NAME = "generateIosConstVal"
internal const val GENERATE_XCCONFIG_TASK_NAME = "generateXcconfig"
internal const val GENERATE_CONFIG_PARAM_TASK_NAME = "generateConfigParam"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import kotlin.test.assertTrue
* End-to-end integration test that verifies the Featured Gradle plugin:
* 1. Generates a ProGuard file at `build/featured/proguard-featured.pro` with correct
* `-assumevalues` rules for declared local flags.
* 2. Auto-wires that file into the AGP release variant so the `generateProguardRules`
* 2. Auto-wires that file into the AGP release variant so the `generateFeaturedProguardRules`
* task participates in `assembleRelease`.
*
* The test uses a minimal Android application fixture copied from
Expand Down Expand Up @@ -49,17 +49,17 @@ class FeaturedPluginIntegrationTest {
// ── Tests ─────────────────────────────────────────────────────────────────

@Test
fun `generateProguardRules task produces correct assumevalues rule for boolean local flag`() {
fun `generateFeaturedProguardRules task produces correct assumevalues rule for boolean local flag`() {
val result =
gradleRunner(projectDir)
.withArguments("generateProguardRules", "--stacktrace")
.withArguments("generateFeaturedProguardRules", "--stacktrace")
.build()

val outcome = result.task(":generateProguardRules")?.outcome
val outcome = result.task(":generateFeaturedProguardRules")?.outcome
assertEquals(
TaskOutcome.SUCCESS,
outcome,
"Expected :generateProguardRules to succeed, got $outcome\n${result.output}",
"Expected :generateFeaturedProguardRules to succeed, got $outcome\n${result.output}",
)

val proFile = projectDir.resolve("build/featured/proguard-featured.pro")
Expand Down Expand Up @@ -138,13 +138,13 @@ class FeaturedPluginIntegrationTest {
.withArguments(args)
.build()

// generateProguardRules must have run as part of the release build.
val proguardOutcome = result.task(":generateProguardRules")?.outcome
// generateFeaturedProguardRules must have run as part of the release build.
val proguardOutcome = result.task(":generateFeaturedProguardRules")?.outcome
assertTrue(
proguardOutcome == TaskOutcome.SUCCESS ||
proguardOutcome == TaskOutcome.UP_TO_DATE ||
proguardOutcome == TaskOutcome.FROM_CACHE,
"Expected :generateProguardRules to participate in assembleRelease (cc=$cc), got $proguardOutcome\n${result.output}",
"Expected :generateFeaturedProguardRules to participate in assembleRelease (cc=$cc), got $proguardOutcome\n${result.output}",
)

// On the second CC-enabled run, the cache is reused AND all task outputs are unchanged,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import kotlin.test.assertTrue

class GenerateProguardRulesTaskRegistrationTest {
@Test
fun `plugin registers generateProguardRules task`() {
fun `plugin registers generateFeaturedProguardRules task`() {
val project = ProjectBuilder.builder().build()
project.plugins.apply("dev.androidbroadcast.featured")

Expand All @@ -19,7 +19,7 @@ class GenerateProguardRulesTaskRegistrationTest {
}

@Test
fun `generateProguardRules task is of correct type`() {
fun `generateFeaturedProguardRules task is of correct type`() {
val project = ProjectBuilder.builder().build()
project.plugins.apply("dev.androidbroadcast.featured")

Expand All @@ -29,7 +29,7 @@ class GenerateProguardRulesTaskRegistrationTest {
}

@Test
fun `generateProguardRules task is in featured group`() {
fun `generateFeaturedProguardRules task is in featured group`() {
val project = ProjectBuilder.builder().build()
project.plugins.apply("dev.androidbroadcast.featured")

Expand All @@ -39,7 +39,7 @@ class GenerateProguardRulesTaskRegistrationTest {
}

@Test
fun `generateProguardRules task has outputFile configured`() {
fun `generateFeaturedProguardRules task has outputFile configured`() {
val project = ProjectBuilder.builder().build()
project.plugins.apply("dev.androidbroadcast.featured")

Expand All @@ -49,7 +49,7 @@ class GenerateProguardRulesTaskRegistrationTest {
}

@Test
fun `generateProguardRules task depends on resolveFeatureFlags task`() {
fun `generateFeaturedProguardRules task depends on resolveFeatureFlags task`() {
val project = ProjectBuilder.builder().build()
project.plugins.apply("dev.androidbroadcast.featured")

Expand Down
Loading