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

Deprecate buildscript {} in subprojects #7456

Open
3flex opened this issue Oct 19, 2018 · 5 comments
Open

Deprecate buildscript {} in subprojects #7456

3flex opened this issue Oct 19, 2018 · 5 comments

Comments

@3flex
Copy link
Contributor

3flex commented Oct 19, 2018

Expected Behavior

buildscript {} in subprojects is deprecated.

Current Behavior

No deprecation warning/no message when buildscript {} is used in subprojects.

Context

Comment from @oehme.

Long story to explain why, but I was searching for info about declaring buildscript {} anywhere other than the root build file, and found a definitive comment from @oehme (linked above) that it's a bad idea to do so. Didn't find any existing issue to track it. Seems release of Gradle 5.0 would be an opportune time to deprecate?

Steps to Reproduce (for bugs)

N/A

Your Environment

N/A

@JLLeitschuh
Copy link
Contributor

JLLeitschuh commented Oct 19, 2018

This would be really unfortunate to see removed.
It's currently the mechanism relied upon to support configuring all of my buildscript code blocks in all sub-projects in one location.

buildscript {
    project.apply {
        from("gradle/repositoryConfig.gradle.kts")
    }
    repositories {
        val buildScriptRepositoryConfig: (RepositoryHandler) -> Unit by extra
        buildScriptRepositoryConfig(this)
    }
    dependencies {
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${property("kotlin.version")}")
    }
}
apply {
    // Gives us access to the extensions declared in the repositoryConfig.gradle.kts file.
    from("gradle/repositoryConfig.gradle.kts")
}
// Configure the sub-project repository resolver first.
subprojects {
    buildscript.repositories {
        val buildScriptRepositoryConfig: (RepositoryHandler) -> Unit by rootProject.extra
        buildScriptRepositoryConfig(this)
    }
}

@oehme is your plan to remove support for the buildscript block in sub-project script files as well?? If that's the case this might be a non-issue (for me at least).

@oehme
Copy link
Contributor

oehme commented Oct 20, 2018

Not sure I understand the "as well". It's the same thing.

@3flex
Copy link
Contributor Author

3flex commented Aug 21, 2019

Ping... Could this be deprecated in Gradle 6.0 so support could be removed in Gradle 7?

@stale
Copy link

stale bot commented Oct 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@stale stale bot added the stale label Oct 6, 2020
@JLLeitschuh JLLeitschuh removed the stale label Oct 7, 2020
@JLLeitschuh
Copy link
Contributor

@gradle/core is this on the queue for idiomatic Gradle?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants