Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

support gradle buildfile named after the directory #33

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cfieber
Copy link

@cfieber cfieber commented Apr 12, 2019

This is really dirty and not likely suitable for inclusion as is, but in our builds we typically include in the settings.gradle this block:

def setBuildFile(project) {
  project.buildFileName = "${project.name}.gradle"
  project.children.each {
    setBuildFile(it)
  }
}

rootProject.children.each {
  setBuildFile it
}

The nice (IMO at least) side-effect of which is that we now don't build.gradle files anywhere but the root of the project, all the other build file names match the project name (which we also match to the sub-project directory names).

This change is a dirty workaround to look for a .gradle build file that matches the name of the current directory while traversing up the path.

If there is any interest in supporting this I could look at making this somewhat less opinionated than it currently is..

@To-da
Copy link

To-da commented Jan 15, 2020

It will be really nice to support this (agree it's convenient to have build file named by module for fulltext search purposes).
I've tested your commit and it works ok.
There're also other projects like https://github.com/ratpack/ratpack or https://github.com/spring-projects/spring-framework which will benefit from this.

btw. solves #4

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

Successfully merging this pull request may close these issues.

None yet

2 participants