Skip to content

Commit 0d15f07

Browse files
committed
Cache GWT version.
1 parent f382c53 commit 0d15f07

File tree

13 files changed

+140
-102
lines changed

13 files changed

+140
-102
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ Simply use Maven to import all the plugins and modules.
8585
### Target Definition
8686
The target defintion build is based off of the Google Cloud Tools. Follow their instructions to build.
8787

88+
* [Install the target.tbd plugin](https://github.com/mbarbero/fr.obeo.releng.targetplatform) - Install the targets plugin.
89+
* Once the plugin is installed, right click on the target.tbd file and set the target.
90+
* Note: The targets will have to be updated by setting the targets. This will regenerate the Eclipse target files.
91+
8892
### Build
8993
Sencha has provided an internal build agent to build.
9094
[Sencha Eclipse Build](https://teamcity.sencha.com/viewType.html?buildTypeId=Gxt3_Gwt_GwtEclipsePlugin)

eclipse/mars/gwt-eclipse-mars.target

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde?>
33
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
4-
<target name="GWT Eclipse Plugin Mars" sequenceNumber="1521650710">
4+
<target name="GWT Eclipse Plugin Mars" sequenceNumber="1534111170">
55
<locations>
66
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
7-
<unit id="org.eclipse.license.feature.group" version="2.0.0.v20180130-0820"/>
7+
<unit id="org.eclipse.license.feature.group" version="2.0.1.v20180423-1114"/>
88
<repository location="http://download.eclipse.org/cbi/updates/license"/>
99
</location>
1010
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
@@ -43,7 +43,7 @@
4343
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20160221192158/repository/"/>
4444
</location>
4545
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
46-
<unit id="com.google.cloud.tools.eclipse.suite.feature.feature.group" version="1.6.0.201803071812"/>
46+
<unit id="com.google.cloud.tools.eclipse.suite.feature.feature.group" version="1.7.1.201807071456"/>
4747
<repository location="https://dl.google.com/eclipse/google-cloud-eclipse/stable/"/>
4848
</location>
4949
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">

eclipse/neon/gwt-eclipse-neon.target

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde?>
33
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
4-
<target name="GWT Eclipse Plugin Neon" sequenceNumber="1521650840">
4+
<target name="GWT Eclipse Plugin Neon" sequenceNumber="1534111212">
55
<locations>
66
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
7-
<unit id="org.eclipse.license.feature.group" version="2.0.0.v20180130-0820"/>
7+
<unit id="org.eclipse.license.feature.group" version="2.0.1.v20180423-1114"/>
88
<repository location="http://download.eclipse.org/cbi/updates/license"/>
99
</location>
1010
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
@@ -23,29 +23,29 @@
2323
<repository location="http://download.eclipse.org/releases/neon"/>
2424
</location>
2525
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
26-
<unit id="org.eclipse.jst.web_sdk.feature.feature.group" version="3.8.0.v201608191717"/>
26+
<unit id="org.eclipse.jst.web_sdk.feature.feature.group" version="3.8.0.v201702270442"/>
2727
<unit id="org.eclipse.jst.server_sdk.feature.feature.group" version="3.4.300.v201606081655"/>
2828
<unit id="org.eclipse.jst.common.fproj.enablement.jdt.sdk.feature.group" version="3.8.0.v201603091933"/>
2929
<unit id="org.eclipse.wst.common.fproj.sdk.feature.group" version="3.7.0.v201505072140"/>
30-
<unit id="org.eclipse.wst.web_sdk.feature.feature.group" version="3.8.0.v201609072018"/>
31-
<unit id="org.eclipse.wst.server_adapters.sdk.feature.feature.group" version="3.2.600.v201606081655"/>
32-
<unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.8.0.v201605251556"/>
33-
<unit id="org.eclipse.jst.web_ui.feature.feature.group" version="3.8.0.v201608191717"/>
34-
<unit id="org.eclipse.wst.web_ui.feature.feature.group" version="3.8.1.v201609072018"/>
30+
<unit id="org.eclipse.wst.web_sdk.feature.feature.group" version="3.8.2.v201702270442"/>
31+
<unit id="org.eclipse.wst.server_adapters.sdk.feature.feature.group" version="3.2.600.v201703062119"/>
32+
<unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.8.0.v201701262139"/>
33+
<unit id="org.eclipse.jst.web_ui.feature.feature.group" version="3.8.0.v201702270442"/>
34+
<unit id="org.eclipse.wst.web_ui.feature.feature.group" version="3.8.2.v201702270442"/>
3535
<unit id="org.eclipse.jst.server_adapters.feature.feature.group" version="3.2.400.v201606081655"/>
3636
<unit id="org.eclipse.jst.server_adapters.ext.feature.feature.group" version="3.3.501.v201609071751"/>
3737
<unit id="org.eclipse.jst.server_ui.feature.feature.group" version="3.4.300.v201606081655"/>
38-
<unit id="org.eclipse.wst.server_adapters.feature.feature.group" version="3.2.500.v201606081655"/>
38+
<unit id="org.eclipse.wst.server_adapters.feature.feature.group" version="3.2.500.v201703062119"/>
3939
<unit id="org.eclipse.jst.server_adapters.ext.sdk.feature.feature.group" version="3.3.501.v201609071751"/>
40-
<unit id="org.eclipse.wst.server_core.feature.feature.group" version="3.3.601.v201605201456"/>
40+
<unit id="org.eclipse.wst.server_core.feature.feature.group" version="3.3.601.v201610211907"/>
4141
<repository location="http://download.eclipse.org/webtools/repository/neon/"/>
4242
</location>
4343
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
4444
<unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
4545
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20160520211859/repository/"/>
4646
</location>
4747
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
48-
<unit id="com.google.cloud.tools.eclipse.suite.feature.feature.group" version="1.6.0.201803071812"/>
48+
<unit id="com.google.cloud.tools.eclipse.suite.feature.feature.group" version="1.7.1.201807071456"/>
4949
<repository location="https://dl.google.com/eclipse/google-cloud-eclipse/stable/"/>
5050
</location>
5151
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">

eclipse/oxygen/gwt-eclipse-oxygen.target

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<?pde?>
33
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
4-
<target name="GWT Eclipse Plugin for Oxygen" sequenceNumber="1501537180">
4+
<target name="GWT Eclipse Plugin for Oxygen" sequenceNumber="1534111079">
55
<locations>
66
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
7-
<unit id="org.eclipse.license.feature.group" version="1.0.1.v20140414-1359"/>
7+
<unit id="org.eclipse.license.feature.group" version="2.0.1.v20180423-1114"/>
88
<repository location="http://download.eclipse.org/cbi/updates/license"/>
99
</location>
1010
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">

plugins/com.gwtplugins.gdt.eclipse.core/src/com/google/gdt/eclipse/core/sdk/AbstractSdk.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,5 @@ private boolean versionsEqual(Sdk otherSdk) {
112112
return (getVersion() == null ? otherSdk.getVersion() == null : getVersion().equals(
113113
otherSdk.getVersion()));
114114
}
115+
115116
}

plugins/com.gwtplugins.gdt.eclipse.core/src/com/google/gdt/eclipse/core/sdk/Sdk.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
import java.io.File;
2424

2525
/**
26-
*
26+
*
2727
*/
2828
public interface Sdk {
29+
2930
/**
3031
* Thrown when there is a problem with an Sdk.
3132
*/
@@ -41,52 +42,50 @@ public SdkException(Throwable cause) {
4142
}
4243

4344
/**
44-
* Returns the set of {@link IClasspathEntry IClasspathEntries} associated
45-
* with this Sdk.
46-
*
47-
* @return the set of {@link IClasspathEntry IClasspathEntries} associated
48-
* with this Sdk
49-
*
45+
* Returns the set of {@link IClasspathEntry IClasspathEntries} associated with this Sdk.
46+
*
47+
* @return the set of {@link IClasspathEntry IClasspathEntries} associated with this Sdk
48+
*
5049
*/
5150
IClasspathEntry[] getClasspathEntries();
5251

5352
/**
5453
* Returns a description of the Sdk.
55-
*
54+
*
5655
* @return Sdk description
5756
*/
5857
String getDescription();
5958

6059
/**
6160
* Returns the installation path for this Sdk.
62-
*
61+
*
6362
* @return installation path for this Sdk
6463
*/
6564
IPath getInstallationPath();
6665

6766
/**
6867
* Returns the name of this Sdk.
69-
*
68+
*
7069
* @return name of this Sdk
7170
*/
7271
String getName();
7372

7473
/**
7574
* Returns the version string for this Sdk.
76-
*
75+
*
7776
* @return the version
7877
*/
7978
String getVersion();
8079

8180
/**
8281
* Returns the set of files that belong in WEB-INF/lib folder.
83-
*
82+
*
8483
* @return set of files that belong in WEB-INF/lib folder
8584
*/
8685
File[] getWebAppClasspathFiles(IProject project);
8786

8887
String toXml();
8988

9089
IStatus validate();
91-
}
9290

91+
}

plugins/com.gwtplugins.gdt.eclipse.core/src/com/google/gdt/eclipse/core/ui/SdkTable.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
* type of Sdk that is managed
6060
*/
6161
public abstract class SdkTable<T extends Sdk> extends Composite {
62+
6263
/**
6364
*
6465
*/
@@ -344,4 +345,5 @@ private void updateRemoteButtonEnabled() {
344345
IStructuredSelection selection = (IStructuredSelection) sdkTableViewer.getSelection();
345346
removeButton.setEnabled(selection.size() != 0);
346347
}
348+
347349
}

plugins/com.gwtplugins.gdt.eclipse.maven/src/com/google/gdt/eclipse/maven/sdk/GWTMavenRuntime.java

Lines changed: 29 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
* A project-based GWT SDK for Maven-based project.
5151
*/
5252
public class GWTMavenRuntime extends ProjectBoundSdk {
53+
5354
public static final String MAVEN_GWT_GROUP_ID = "com.google.gwt";
5455
public static final String MAVEN_GWT_DEV_JAR_ARTIFACT_ID = "gwt-dev";
5556
public static final String MAVEN_GWT_USER_ARTIFACT_ID = "gwt-user";
@@ -92,11 +93,10 @@ public URLClassLoader createClassLoader() throws SdkException, MalformedURLExcep
9293
* This method's implementation breaks the general contract of
9394
* {@link com.google.gwt.eclipse.core.runtime.GwtSdk#getClasspathEntries()} .
9495
*
95-
* The general contract states that the entries returned should be the raw entries on the build
96-
* path that correspond to the SDK. This method returns the resolved entry on the build path that
97-
* corresponds to the gwt-user library. It then returns the path to the gwt-dev library that's a
98-
* peer of the gwt-user library in the Maven repository. This library may not be on the build
99-
* classpath.
96+
* The general contract states that the entries returned should be the raw entries on the build path that correspond
97+
* to the SDK. This method returns the resolved entry on the build path that corresponds to the gwt-user library. It
98+
* then returns the path to the gwt-dev library that's a peer of the gwt-user library in the Maven repository. This
99+
* library may not be on the build classpath.
100100
*
101101
* TODO: Reconsider the general contract of this method.
102102
*
@@ -115,8 +115,7 @@ public IClasspathEntry[] getClasspathEntries() {
115115
File gwtDevJar = getDevJar();
116116

117117
if (gwtDevJar != null) {
118-
classpathEntries.add(JavaCore.newLibraryEntry(
119-
Path.fromOSString(gwtDevJar.getAbsolutePath()), null, null));
118+
classpathEntries.add(JavaCore.newLibraryEntry(Path.fromOSString(gwtDevJar.getAbsolutePath()), null, null));
120119
}
121120
}
122121

@@ -134,19 +133,11 @@ public int compare(IClasspathEntry o1, IClasspathEntry o2) {
134133

135134
return classpathEntryArray;
136135
} catch (JavaModelException e) {
137-
Activator
138-
.getDefault()
139-
.getLog()
140-
.log(
141-
new Status(IStatus.ERROR, Activator.PLUGIN_ID,
142-
"Unable to generate classpath entries for the maven-based GWT runtime.", e));
136+
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
137+
"Unable to generate classpath entries for the maven-based GWT runtime.", e));
143138
} catch (SdkException sdke) {
144-
Activator
145-
.getDefault()
146-
.getLog()
147-
.log(
148-
new Status(IStatus.ERROR, Activator.PLUGIN_ID,
149-
"Unable to generate classpath entries for the maven-based GWT runtime.", sdke));
139+
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
140+
"Unable to generate classpath entries for the maven-based GWT runtime.", sdke));
150141
}
151142

152143
return AbstractSdk.NO_ICLASSPATH_ENTRIES;
@@ -160,9 +151,8 @@ public File getDevJar() throws SdkException, JavaModelException {
160151
throw new SdkException("Unable to locate gwt-user.jar");
161152
}
162153

163-
IPath path =
164-
MavenUtils.getArtifactPathForPeerMavenArtifact(classpathEntry.getPath(),
165-
MAVEN_GWT_GROUP_ID, MAVEN_GWT_DEV_JAR_ARTIFACT_ID);
154+
IPath path = MavenUtils.getArtifactPathForPeerMavenArtifact(classpathEntry.getPath(), MAVEN_GWT_GROUP_ID,
155+
MAVEN_GWT_DEV_JAR_ARTIFACT_ID);
166156
if (path == null) {
167157
throw new SdkException("Unable to locate gwt-dev.jar");
168158
}
@@ -175,8 +165,8 @@ public File getDevJar() throws SdkException, JavaModelException {
175165
}
176166

177167
/**
178-
* Maven-based GWT SDKs do not have a clear installation path. So, we say that the installation
179-
* path corresponds to: <code><repository path>/<group path></code>.
168+
* Maven-based GWT SDKs do not have a clear installation path. So, we say that the installation path corresponds to:
169+
* <code><repository path>/<group path></code>.
180170
*/
181171
@Override
182172
public IPath getInstallationPath() {
@@ -193,20 +183,15 @@ public IPath getInstallationPath() {
193183
}
194184
return p.removeLastSegments(3);
195185
} catch (JavaModelException e) {
196-
Activator
197-
.getDefault()
198-
.getLog()
199-
.log(
200-
new Status(IStatus.ERROR, Activator.PLUGIN_ID,
201-
"Unable to determine installation path for the maven-based GWT runtime.", e));
186+
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
187+
"Unable to determine installation path for the maven-based GWT runtime.", e));
202188
}
203189

204190
return null;
205191
}
206192

207193
/**
208-
* Maven-based sdks do not contribute libraries that should be placed in the
209-
* <code>WEB-INF/lib</code> folder.
194+
* Maven-based sdks do not contribute libraries that should be placed in the <code>WEB-INF/lib</code> folder.
210195
*/
211196
@Override
212197
public File[] getWebAppClasspathFiles(IProject project) {
@@ -230,14 +215,13 @@ public IStatus validate() {
230215
* @throws JavaModelException
231216
*/
232217
private IClasspathEntry findGwtCodeServerClasspathEntry() throws JavaModelException {
233-
IType type =
234-
javaProject.findType(GwtLaunchConfigurationProcessorUtilities.GWT_CODE_SERVER);
218+
IType type = javaProject.findType(GwtLaunchConfigurationProcessorUtilities.GWT_CODE_SERVER);
235219
if (type == null) {
236220
return null;
237221
}
238222

239-
IPackageFragmentRoot packageFragmentRoot =
240-
(IPackageFragmentRoot) type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
223+
IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) type
224+
.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
241225
if (packageFragmentRoot.getKind() == IPackageFragmentRoot.K_BINARY) {
242226
return JavaCore.newLibraryEntry(packageFragmentRoot.getPath(), null, null);
243227
}
@@ -247,10 +231,10 @@ private IClasspathEntry findGwtCodeServerClasspathEntry() throws JavaModelExcept
247231

248232
private IClasspathEntry findGwtUserClasspathEntry() throws JavaModelException {
249233
/*
250-
* Note that the type that we're looking for to determine if we're part of the gwt-user library
251-
* is different than the one that is used by the superclass. This is because the class that the
252-
* superclass is querying for, "com.google.gwt.core.client.GWT", also exists in the gwt-servlet
253-
* library, and for some reason, this sometimes ends up on the build path for Maven projects.
234+
* Note that the type that we're looking for to determine if we're part of the gwt-user library is different than
235+
* the one that is used by the superclass. This is because the class that the superclass is querying for,
236+
* "com.google.gwt.core.client.GWT", also exists in the gwt-servlet library, and for some reason, this sometimes
237+
* ends up on the build path for Maven projects.
254238
*
255239
* TODO: See why Maven is putting gwt-servlet on the build path.
256240
*
@@ -262,8 +246,8 @@ private IClasspathEntry findGwtUserClasspathEntry() throws JavaModelException {
262246
return null;
263247
}
264248

265-
IPackageFragmentRoot packageFragmentRoot =
266-
(IPackageFragmentRoot) type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
249+
IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) type
250+
.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
267251
if (packageFragmentRoot.getKind() == IPackageFragmentRoot.K_BINARY) {
268252
// TODO: If the Maven javadoc and source libs for gwt-dev.jar are
269253
// available, attach them here.
@@ -280,12 +264,13 @@ private IClasspathEntry findJavaXValidationClasspathEntry() throws JavaModelExce
280264
return null;
281265
}
282266

283-
IPackageFragmentRoot packageFragmentRoot =
284-
(IPackageFragmentRoot) type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
267+
IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) type
268+
.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
285269
if (packageFragmentRoot.getKind() == IPackageFragmentRoot.K_BINARY) {
286270
return JavaCore.newLibraryEntry(packageFragmentRoot.getPath(), null, null);
287271
}
288272

289273
return null;
290274
}
275+
291276
}

plugins/com.gwtplugins.gwt.eclipse.core.test/src/com/google/gwt/eclipse/core/runtime/GWTJarsRuntimeTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,12 @@ public void testGetClasspathEntries() throws Exception {
7575

7676
// Verify that our classpath entries point at the GWT javadoc.
7777
IClasspathAttribute[] extraAttributes = gwtClasspathEntry.getExtraAttributes();
78-
assertTrue("No extra attributes seen for classpath entry: " + gwtClasspathEntry,
79-
extraAttributes.length > 0);
80-
assertEquals(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME,
81-
extraAttributes[0].getName());
78+
assertTrue("No extra attributes seen for classpath entry: " + gwtClasspathEntry, extraAttributes.length > 0);
79+
assertEquals(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, extraAttributes[0].getName());
8280

8381
/*
84-
* Entries should have their javadoc location point at a directory with "index.html".
85-
* Strangely, the values of these classpath attributes are specified as "file://" urls.
82+
* Entries should have their javadoc location point at a directory with "index.html". Strangely, the values of
83+
* these classpath attributes are specified as "file://" urls.
8684
*/
8785
File jdLocation = new File(new URL(extraAttributes[0].getValue()).getFile());
8886
assertTrue("Javadoc file does not exist", jdLocation.exists());
@@ -141,8 +139,7 @@ public void testGetValidationClasspathEntries() throws Exception {
141139
}
142140

143141
// Verify that the sources and binary entries correspond to each other
144-
assertTrue(Util.findSourcesJarForClassesJar(binaryEntry.getPath()).equals(
145-
sourcesEntry.getPath()));
142+
assertTrue(Util.findSourcesJarForClassesJar(binaryEntry.getPath()).equals(sourcesEntry.getPath()));
146143

147144
// Verify that the source attachment path has been set for the binary
148145
// entry
@@ -165,4 +162,5 @@ private boolean isGWTJar(GWTJarsRuntime jarsRuntime, String jarName) {
165162
|| jarName.equalsIgnoreCase(Util.getDevJarName(jarsRuntime.getInstallationPath()))
166163
|| "gwt-servlet.jar".equals(jarName);
167164
}
165+
168166
}

plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/properties/GWTProjectProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,4 +301,5 @@ private static List<String> toFileNames(List<File> files) {
301301
private GWTProjectProperties() {
302302
// Not instantiable
303303
}
304+
304305
}

0 commit comments

Comments
 (0)