[GRADLE-2744] remapping subproject location in settings.gradle prevent working from inside its folder Created: 10/Apr/13  Updated: 02/Sep/13  Resolved: 02/Sep/13

Status: Resolved
Project: Gradle
Affects Version/s: 1.5
Fix Version/s: 1.8-rc-1

Type: Bug
Reporter: Xavier Ducrohet Assignee: René Gröschke (Inactive)
Resolution: Fixed Votes: 0


Given the following settings.gradle:

include 'project1'
include 'project2'
project(':project2').projectDir = new File('libs/project2')

Doing any gradle command from the libs/project2 folder fails to evaluate all projects defined in settings.gradle.

Gradle basically considers project2 to be a single project setup, which makes dependency on other subprojects broken unless the command is ran from the root folder.

Is this expected? Is there no way to have a hierarchical folder structure that does not map to a hierarchical project structure.

I don't want "libs" to be a project.

Comment by Xavier Ducrohet [ 20/Jun/13 ]

Turns out that this is solved by doing instead

project(':project2').projectDir = new File(rootDir, 'libs/project2')

Generated at Wed Jun 30 12:30:19 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.