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

Updates to gradle properties should be picked up when doing full build #924

Merged
merged 1 commit into from
Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
public class GradleBuildSupport implements IBuildSupport {

public static final String GRADLE_SUFFIX = ".gradle";
public static final String GRADLE_PROPERTIES = "gradle.properties";

@Override
public boolean applies(IProject project) {
Expand All @@ -57,7 +58,8 @@ public void update(IProject project, boolean force, IProgressMonitor monitor) th

@Override
public boolean isBuildFile(IResource resource) {
if (resource != null && resource.getType() == IResource.FILE && resource.getName().endsWith(GRADLE_SUFFIX) && resource.getProject() != null && ProjectUtils.isGradleProject(resource.getProject())) {
if (resource != null && resource.getType() == IResource.FILE && (resource.getName().endsWith(GRADLE_SUFFIX) || resource.getName().equals(GRADLE_PROPERTIES)) && resource.getProject() != null
&& ProjectUtils.isGradleProject(resource.getProject())) {
try {
if (!ProjectUtils.isJavaProject(resource.getProject())) {
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@ public void testBuildFile() throws Exception {
assertTrue(projectsManager.isBuildFile(file));
}

@Test
public void testGradlePropertiesFile() throws Exception {
IProject project = importSimpleJavaProject();
IFile file = project.getFile("/bin/gradle.properties");
assertFalse(projectsManager.isBuildFile(file));
importProjects("gradle/gradle-withoutjava");
project = getProject("gradle-withoutjava");
file = project.getFile("/gradle.properties");
assertTrue(projectsManager.isBuildFile(file));
}

@Test
public void testJava11Project() throws Exception {
IProject project = importGradleProject("gradle-11");
Expand Down