Here are the examples of the java api org.netbeans.modules.groovy.grails.api.GrailsProjectConfig.getGrailsPlatform() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
17
View Complete Implementation : BootClassPathImplementation.java
Copyright Apache License 2.0
Author : apache
Copyright Apache License 2.0
Author : apache
public List<PathResourceImplementation> getResources() {
long currentId;
synchronized (this) {
if (resourcesCache != null) {
return resourcesCache;
}
currentId = eventId;
}
JavaPlatform jp = config.getJavaPlatform();
final List<PathResourceImplementation> result = new ArrayList<PathResourceImplementation>();
if (jp != null) {
// TODO: May also listen on CP, but from Platform it should be fixed.
final ClreplacedPath cp = jp.getBootstrapLibraries();
replacedert cp != null : jp;
for (ClreplacedPath.Entry entry : cp.entries()) {
result.add(ClreplacedPathSupport.createResource(entry.getURL()));
}
}
GrailsPlatform gp = config.getGrailsPlatform();
if (gp != null) {
final ClreplacedPath cp = gp.getClreplacedPath();
replacedert cp != null : gp;
for (ClreplacedPath.Entry entry : cp.entries()) {
result.add(ClreplacedPathSupport.createResource(entry.getURL()));
}
}
synchronized (this) {
if (currentId == eventId) {
if (resourcesCache == null) {
resourcesCache = Collections.unmodifiableList(result);
}
return resourcesCache;
}
return Collections.unmodifiableList(result);
}
}
16
View Complete Implementation : BuildConfig.java
Copyright Apache License 2.0
Author : apache
Copyright Apache License 2.0
Author : apache
private File getProjectPluginsDir11() {
replacedert Thread.holdsLock(this);
try {
if (buildSettingsInstance != null) {
Method getProjectPluginsDirMethod = // NOI18N
buildSettingsInstance.getClreplaced().getMethod(// NOI18N
"getProjectPluginsDir", new Clreplaced[] {});
Object value = getProjectPluginsDirMethod.invoke(buildSettingsInstance, new Object[] {});
if (value instanceof File) {
File file = (File) value;
if (!file.isAbsolute()) {
file = new File(projectRoot, file.getPath());
}
return FileUtil.normalizeFile(file);
}
}
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
LOGGER.log(Level.FINE, null, ex);
}
GrailsProjectConfig config = GrailsProjectConfig.forProject(project);
GrailsPlatform platform = config.getGrailsPlatform();
if (platform.isConfigured()) {
return FileUtil.normalizeFile(new File(System.getProperty("user.home"), // NOI18N
".grails" + File.separator + config.getGrailsPlatform().getVersion().toString() + File.separator + "projects" + File.separator + projectRoot.getName() + File.separator + // NOI18N
"plugins"));
}
return null;
}
16
View Complete Implementation : BuildConfig.java
Copyright Apache License 2.0
Author : apache
Copyright Apache License 2.0
Author : apache
private File getGlobalPluginsDir11() {
replacedert Thread.holdsLock(this);
try {
if (buildSettingsInstance != null) {
Method getGlobalPluginsDirMethod = // NOI18N
buildSettingsInstance.getClreplaced().getMethod(// NOI18N
"getGlobalPluginsDir", new Clreplaced[] {});
Object value = getGlobalPluginsDirMethod.invoke(buildSettingsInstance, new Object[] {});
if (value instanceof File) {
File file = (File) value;
if (!file.isAbsolute()) {
file = new File(projectRoot, file.getPath());
}
return FileUtil.normalizeFile(file);
}
}
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
LOGGER.log(Level.FINE, null, ex);
}
GrailsProjectConfig config = GrailsProjectConfig.forProject(project);
GrailsPlatform platform = config.getGrailsPlatform();
if (platform.isConfigured()) {
return FileUtil.normalizeFile(new File(System.getProperty("user.home"), // NOI18N
".grails" + File.separator + config.getGrailsPlatform().getVersion().toString() + File.separator + // NOI18N
"global-plugins"));
}
return null;
}