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

"Refresh Gradle Project" changes order of buildCommands in project file #543

Closed
TTTThomas opened this issue Aug 7, 2017 · 4 comments
Closed

Comments

@TTTThomas
Copy link

TTTThomas commented Aug 7, 2017

Before the call of "refresh gradle project", the commands in the file .project are ordered in the following way:

		<buildCommand>
			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.wst.common.project.facet.core.builder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.jboss.tools.jst.web.kb.kbbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.jboss.tools.cdi.core.cdibuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.wst.validation.validationbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>

Afterwards the gradle builder is added but the order of the commands changed:

<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.wst.common.project.facet.core.builder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.wst.validation.validationbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.jboss.tools.jst.web.kb.kbbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.jboss.tools.cdi.core.cdibuilder</name>
			<arguments>
			</arguments>
		</buildCommand>

This leads to the following eclipse error:
CDI Core Validator cannot run on project because Validation Builder precedes CDI (Contexts and Dependency Injection) Builder.

@donat donat added this to the Buildship 2.1.3 milestone Aug 14, 2017
@donat donat modified the milestones: Buildship 2.2, Buildship 2.2.1 Nov 9, 2017
@donat
Copy link
Contributor

donat commented Jan 5, 2018

Hi! Sorry for the late reply. Where do those project natures come from? I've run a quick test and if I declare the build commands in the build script, then the ordering stays stable.

apply plugin: 'eclipse'

eclipse {
    project {
        buildCommand 'org.jboss.tools.cdi.core.cdibuilder'
        buildCommand 'org.eclipse.wst.validation.validationbuilder'
    }
}

@donat donat closed this as completed Jan 5, 2018
@donat donat removed this from the Buildship 2.2.1 milestone Jan 5, 2018
@mauromol
Copy link

mauromol commented Jan 5, 2018

I'm not the reporter, but I suppose these are "custom" build commands which Buildship now (correctly) keeps as per #392. Probably, if in this case ordering is important, the only way to go is to declare them in the build script...

@TTTThomas
Copy link
Author

eclipse {
    project {
			buildCommands.clear();
			buildCommand 'org.eclipse.jdt.core.javabuilder'
			buildCommand 'org.eclipse.wst.common.project.facet.core.builder'
                        ........
   }
}

Works for me.

Thanks.

@donat
Copy link
Contributor

donat commented Jan 8, 2018

@mauromol That is correct.
@TTTThomas I'm glad you've found the solution.

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

3 participants