Skip to content

Commit

Permalink
Change location of .tooling
Browse files Browse the repository at this point in the history
Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
  • Loading branch information
snjeza committed Feb 2, 2021
1 parent 6f4e36f commit 9f3c8f9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import java.io.File;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import org.eclipse.buildship.core.BuildConfiguration;
Expand Down Expand Up @@ -92,9 +92,9 @@ public void update(IProject project, boolean force, IProgressMonitor monitor) th
private boolean isRoot(IProject project, GradleBuild gradleBuild, IProgressMonitor monitor) {
if (gradleBuild instanceof InternalGradleBuild) {
CancellationTokenSource tokenSource = GradleConnector.newCancellationTokenSource();
Collection<EclipseProject> eclipseProjects = ((InternalGradleBuild) gradleBuild).getModelProvider().fetchModels(EclipseProject.class, FetchStrategy.LOAD_IF_NOT_CACHED, tokenSource, monitor);
Map<String, EclipseProject> eclipseProjects = ((InternalGradleBuild) gradleBuild).getModelProvider().fetchModels(EclipseProject.class, FetchStrategy.LOAD_IF_NOT_CACHED, tokenSource, monitor);
File projectDirectory = project.getLocation().toFile();
for (EclipseProject eclipseProject : eclipseProjects) {
for (EclipseProject eclipseProject : eclipseProjects.values()) {
File eclipseProjectDirectory = eclipseProject.getProjectDirectory();
if (eclipseProjectDirectory.equals(projectDirectory)) {
return eclipseProject.getParent() == null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public ValidationResult checkWrapper(String baseDir) throws CoreException {
reader = new InputStreamReader(new FileInputStream(versionFile), Charsets.UTF_8);
String json = CharStreams.toString(reader);
Gson gson = new GsonBuilder().create();
TypeToken<List<Map<String, String>>> typeToken = new TypeToken<List<Map<String, String>>>() {
TypeToken<List<Map<String, String>>> typeToken = new TypeToken<>() {
};
List<Map<String, String>> versions = gson.fromJson(json, typeToken.getType());
//@formatter:off
Expand Down Expand Up @@ -253,14 +253,24 @@ private static String read(File file) {
}

private static File getVersionCacheFile() {
return new File(System.getProperty("user.home"), ".tooling/gradle/versions.json");
String xdgCache = getXdgCache();
return new File(xdgCache, "tooling/gradle/versions.json");
}

private static String getXdgCache() {
String xdgCache = System.getenv("XDG_CACHE_HOME");
if (xdgCache == null) {
xdgCache = System.getProperty("user.home") + "/.cache/";
}
return xdgCache;
}

public static File getSha256CacheFile() {
String checksumCache = System.getProperty("gradle.checksum.cacheDir");
File file;
if (checksumCache == null || checksumCache.isEmpty()) {
file = new File(System.getProperty("user.home"), ".tooling/gradle/checksums");
String xdgCache = getXdgCache();
file = new File(xdgCache, "tooling/gradle/checksums");
} else {
file = new File(checksumCache);
}
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.buildship.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/buildship/updates/e415/snapshots/3.x/3.1.5.v20200806-2157-s/"/>
<repository location="https://download.eclipse.org/buildship/updates/e415/snapshots/3.x/3.1.5.v20210112-1646-s"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.m2e.feature.feature.group" version="0.0.0"/>
Expand Down

0 comments on commit 9f3c8f9

Please sign in to comment.