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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悩 Declarative Gradle #28337

Open
1 of 4 tasks
pioterj opened this issue Nov 17, 2023 · 0 comments
Open
1 of 4 tasks

馃悩 Declarative Gradle #28337

pioterj opened this issue Nov 17, 2023 · 0 comments
Labels
a:epic in:declarative-dsl roadmap Initiative on the public Gradle roadmap

Comments

@pioterj
Copy link
Member

pioterj commented Nov 17, 2023

At Gradle, part of our vision is to provide an elegant and extensible declarative build language that enables expressing any build clearly and understandably. We are working on Declarative Gradle to realize that part of the vision.

Our key principles are:

  1. Ease of use for regular software developers.
    Software developers should be able to define any software in a clear and understandable way so that they can build their software without the need to understand the details of how the build system works.
  2. Complete flexibility for build engineers and advanced users.
    Build engineers should maintain the current level of flexibility and be able to automate a wide range of software build automation scenarios with custom build logic.
  3. Excellent IDE integration.
    Importing the software project to the IDE and interacting with it should be fast and fully reliable.
    IDEs and other tools should be able to change the software definition automatically or through UI reliably.

Concept

This is how Declarative Gradle could look like:

Expand code
// Declare the type of software that the project produces
// There is no plugin application, as Gradle infers this from the "javaLibrary" type definition
javaLibrary {
    // All information about the library is grouped here

    // GroupID/ArtifactID/Version for publishing
    publishedAs("my-group:my-lib:2.0")

    // Common dependencies for all targets
    dependencies {
        api("some:lib:1.2")
        implementation(projects.someLib)
    }

    // A library might have more than one target
    targets {
        // All information about specific targets is grouped here
        
        // Declare Java 11 as a target
        java(11) {
            // Specific information about Java 11 target
            
            // An additional dependency that is used only for Java 11
            dependencies {
                implementation("some:back-port-lib:1.5")
            }
        }

        // Declare Java 21 as a target, with no additional information
        java(21)
    }
    
    tests {
        // All information about the tests is grouped here
        
        unit {
            // Dependencies for the unit tests
            dependencies {
                implementation("some:other-lib:1.4")
            }
        }
    }
}

References

Discuss

Status

Declarative Gradle is an experimental project. Currently, no compatibility is guaranteed, and there is no commitment to the DSL syntax and available features. More information will be released soon. Any feedback is welcome!

Key milestones

@oleg-nenashev oleg-nenashev transferred this issue from gradle/build-tool-roadmap Mar 4, 2024
@oleg-nenashev oleg-nenashev added a:feature A new functionality a:epic roadmap Initiative on the public Gradle roadmap and removed to-triage labels Mar 4, 2024
@oleg-nenashev oleg-nenashev pinned this issue Mar 4, 2024
@oleg-nenashev oleg-nenashev changed the title Declarative Gradle 馃悩 Declarative Gradle Mar 4, 2024
@ov7a ov7a added in:declarative-dsl and removed a:feature A new functionality to-triage labels Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:epic in:declarative-dsl roadmap Initiative on the public Gradle roadmap
Projects
Status: In Progress
Development

No branches or pull requests

3 participants