Fix GenEclipseRuns not using correct eclipse output directories #1039
+71
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is to address #1038
The eclipse runs were not using the correct directories.
Basically, because I didn't want to figure out how to pass in the eclipseModel to a task. I do all the work at configuration time.
But also this is called during afterEvalute because thats when MinecraftDependency.handle is called.
That needs to be fixed, as only validation should be happening in afterEvaluate, but thats a bigger thing for later.
I deleted getEclipseOutputDir because it is part of the internal api, and thus not what I consider a breaking change.
In its place, i grab the EclipseModel as needed.
From the EclipseModel I use:
From SourceSet I use:
This works for now, if this looks sane enough to you @Jonathing pull.
Copy pasting some relevant details form discord:
Okay so The EclipseClasspath task uses the EclipseModel. Which includes SourceFolder entries.
These entries have a 'output' value which is set via SourceFoldersCreator
Who collectSourceSetoutputPaths function basically just does:
Easy enough to mimic. Except for the base part. That is gotten from EclipseClasspath.getBaseSourceOutputDir, relativzed to the project directory.
Which for completeness sake, defaults to project.dir("bin")
This is all simple enough if we can figure out how to pass in the EclispeModel and sourceSets into the task.