Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract Repositories from settings.gradle.kts #7

Open
raphiz opened this issue Nov 8, 2023 · 1 comment
Open

Extract Repositories from settings.gradle.kts #7

raphiz opened this issue Nov 8, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@raphiz
Copy link
Owner

raphiz commented Nov 8, 2023

Currently, the Repositories must be hard coded twice, once in the settings.gradle.kts and once in nix. It would be nice if the nix expression could extract the Repositories used from the settings.gradle.kts

@raphiz raphiz added the enhancement New feature or request label Nov 8, 2023
@raphiz
Copy link
Owner Author

raphiz commented Jun 24, 2024

Using an IFD + Gradle init script should work. Here is a quick proof of concept:

gradle -q -I ./listRepositories.gradle listRepositories
// listRepositories.gradle
gradle.settingsEvaluated { settings ->
    rootProject {
        tasks.register("listRepositories") {
            doLast {
                settings.pluginManagement.repositories.forEach { repo ->
                    if(repo.url != null) println(repo.url)
                }
                settings.dependencyResolutionManagement.repositories.forEach { repo ->
                    if(repo.url != null) println(repo.url)
                }
            }
        }
    }
}

@raphiz raphiz added the help wanted Extra attention is needed label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant