Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lacasseio/sample-reselect-variant
Demonstrate how to reselect a variant within a dependency tree via explicit dependency
https://github.com/lacasseio/sample-reselect-variant
Last synced: about 1 month ago
JSON representation
Demonstrate how to reselect a variant within a dependency tree via explicit dependency
- Host: GitHub
- URL: https://github.com/lacasseio/sample-reselect-variant
- Owner: lacasseio
- Created: 2023-12-18T15:44:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-29T19:30:08.000Z (11 months ago)
- Last Synced: 2024-10-12T11:32:49.570Z (2 months ago)
- Language: Java
- Size: 69.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sample: Reselect variant in dependency tree
As opposed to the previous version of this sample (see Git history), the sample will rewrite the dependencies of each project to avoid rebuilding the same library twice (debug and release).
To accomplish this, we need a global plugin that understand the request (e.g. `-Pdbg`) and perform the modification on affected projects.
The global plugin is `com.example.debuggable-product` and is applied to the `settings.gradle`, aka global to a project.
The plugin will search all project for any C++ components and perform the dependency modification required.We no longer need to create a conflict as the dependency that we resolves already depends on the right, debug vs release, dependencies.
Note that this sample ignores the case where a transitive dependency of an external dependency is required to be switched to a debug binary.
In this case, you would need to use the trick from the previous version of this sample.## Demonstration
```
$ ./gradlew :product:verify -Pdbg=com.example:lib1,com.example:lib4
> Task :composite-build:lib4:compileDebugCpp
> Task :composite-build:lib4:linkDebug
> Task :lib1:compileDebugCpp
> Task :lib2:compileReleaseCpp
> Task :lib3:compileReleaseCpp
> Task :lib2:linkRelease
> Task :lib2:stripSymbolsRelease
> Task :app:compileReleaseCpp
> Task :lib1:linkDebug
> Task :lib3:linkRelease
> Task :app:linkRelease
> Task :lib3:stripSymbolsRelease
> Task :app:stripSymbolsRelease> Task :product:verify
./app/build/exe/main/release/stripped/app
./lib3/build/lib/main/release/stripped/liblib3.dylib
./lib1/build/lib/main/debug/liblib1.dylib
./composite-build/lib4/build/lib/main/debug/liblib4.dylib
./lib2/build/lib/main/release/stripped/liblib2.dylibBUILD SUCCESSFUL in 2s
```Note that only the debug variant of `lib1` and `lib4` are built.