Skip to content

Commit

Permalink
Move jsinterop-annotations source code out of GWT.
Browse files Browse the repository at this point in the history
jsinterop-annotations has its own repo on github. This CL removes
the code from the gwt repo and add a dependency to the jar file
now present in tools repo. The gwt-user.jar distributed in the zip
will still contain these classes, but the maven version will correctly
reference the jar already present in maven central.

Change-Id: I5c341e1ae5ad48ea3bf8104d781b1d16fccdef4a
  • Loading branch information
Julien Dramaix authored and jDramaix committed May 2, 2020
1 parent 4396af7 commit 8188fd9
Show file tree
Hide file tree
Showing 23 changed files with 6 additions and 776 deletions.
36 changes: 1 addition & 35 deletions maven/lib-gwt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ function warnJavaDoc () {
function maven-gwt() {
local gwtMavenVersion=$1
shift
local jsinteropMavenVersion=$1
shift
local gwtSdkArchive=$1
shift
local mavenRepoUrl=$1
Expand Down Expand Up @@ -69,16 +67,12 @@ function maven-gwt() {
JAVADOC_FILE_PATH=$RANDOM_DIR/gwt-javadoc.jar
[ -d $GWT_EXTRACT_DIR/doc/javadoc ] && jar cf $JAVADOC_FILE_PATH -C $GWT_EXTRACT_DIR/doc/javadoc .

# Create a dummy javadoc JAR for JsInterop (gwt-javadoc is too heavy)
JSINTEROP_JAVADOC_FILE_PATH=$RANDOM_DIR/jsinterop-javadoc.jar
jar cf $JSINTEROP_JAVADOC_FILE_PATH -C $pomDir/jsinterop README.javadoc

# Generate POMs with correct version
for template in `find $pomDir -name pom-template.xml`
do
dir=`dirname $template`
pushd $dir > /dev/null
sed -e "s|\${gwtVersion}|$gwtMavenVersion|g" -e "s|\${jsinteropVersion}|$jsinteropMavenVersion|g" pom-template.xml >pom.xml
sed -e "s|\${gwtVersion}|$gwtMavenVersion|g" pom-template.xml >pom.xml
popd > /dev/null
done

Expand All @@ -88,24 +82,6 @@ function maven-gwt() {
gwtLibs="${gwtLibs} elemental"
fi

jsinteropLibs='annotations'

# Create jsinterop libs
for i in $jsinteropLibs
do
echo "Creating jsinterop-${i}.jar and jsinterop-${i}-sources.jar"
zip $GWT_EXTRACT_DIR/gwt-user.jar --copy --out $GWT_EXTRACT_DIR/jsinterop-${i}.jar \
"jsinterop/${i}/*"
zip -d $GWT_EXTRACT_DIR/jsinterop-${i}.jar \
"jsinterop/${i}/*.java" "jsinterop/${i}/*.gwt.xml"
zip $GWT_EXTRACT_DIR/gwt-user.jar --copy --out $GWT_EXTRACT_DIR/jsinterop-${i}-sources.jar \
"jsinterop/${i}/*.java" "jsinterop/${i}/*.gwt.xml"
echo "Removing jsinterop/${i} from gwt-user"
zip -d $GWT_EXTRACT_DIR/gwt-user.jar "jsinterop/${i}/*"
echo "Removing jsinterop/${i} from gwt-servlet"
zip -d $GWT_EXTRACT_DIR/gwt-servlet.jar "jsinterop/${i}/*"
done

echo "Removing bundled third-parties from gwt-dev"
zip -q $GWT_EXTRACT_DIR/gwt-dev.jar --copy --out $GWT_EXTRACT_DIR/gwt-dev-trimmed.jar \
"com/google/gwt/*" "org/eclipse/jdt/*"
Expand Down Expand Up @@ -165,15 +141,5 @@ function maven-gwt() {
|| die
done

# Deploy jsInterop jars
maven-deploy-file $mavenRepoUrl $mavenRepoId $pomDir/jsinterop/pom.xml $pomDir/jsinterop/pom.xml || die

for i in $jsinteropLibs
do
maven-deploy-file $mavenRepoUrl $mavenRepoId $GWT_EXTRACT_DIR/jsinterop-${i}.jar $pomDir/jsinterop/${i}/pom.xml \
$JSINTEROP_JAVADOC_FILE_PATH $GWT_EXTRACT_DIR/jsinterop-${i}-sources.jar \
|| die
done

finishAndCleanup
}
5 changes: 0 additions & 5 deletions maven/poms/gwt/gwt-user/pom-template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
<groupId>com.google.jsinterop</groupId>
<artifactId>jsinterop-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.google.jsinterop</groupId>
<artifactId>jsinterop-annotations</artifactId>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
Expand Down
6 changes: 2 additions & 4 deletions maven/poms/gwt/pom-template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@
</dependency>
<dependency>
<groupId>com.google.jsinterop</groupId>
<artifactId>jsinterop</artifactId>
<version>${jsinteropVersion}</version>
<type>pom</type>
<scope>import</scope>
<artifactId>jsinterop-annotations</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
Expand Down
5 changes: 0 additions & 5 deletions maven/poms/jsinterop/README.javadoc

This file was deleted.

15 changes: 0 additions & 15 deletions maven/poms/jsinterop/annotations/pom-template.xml

This file was deleted.

38 changes: 0 additions & 38 deletions maven/poms/jsinterop/pom-template.xml

This file was deleted.

9 changes: 0 additions & 9 deletions maven/push-gwt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ VERSION_REGEX='[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*-*.*'

# use GWT_VERSION to specify the default version or get it from the file name
gwtVersionDefault=${GWT_VERSION:=$(expr "$gwtPathDefault" : '.*gwt-\('$VERSION_REGEX'\)\.zip')}
jsinteropVersionDefault=${JSINTEROP_VERSION:=HEAD-SNAPSHOT}

# prompt for info
read -e -p"GWT version for Maven (${gwtVersionDefault:-ex: HEAD-SNAPSHOT}): " gwtVersion
Expand All @@ -45,13 +44,6 @@ if test "$gwtVersion" != "HEAD-SNAPSHOT" && ! expr "$gwtVersion" : "$VERSION_REG
exit 1
fi

read -e -p"JsInterop version for Maven (${jsinteropVersionDefault:-ex: HEAD-SNAPSHOT}): " jsinteropVersion
jsinteropVersion=${jsinteropVersion:=$jsinteropVersionDefault}
if test "$jsinteropVersion" != "HEAD-SNAPSHOT" && ! expr "$jsinteropVersion" : "$VERSION_REGEX" >/dev/null; then
echo "Please enter a version of the form x.y.z or x.y.z-abc"
exit 1
fi

read -e -p"Path to GWT distro zip $gwtPathPrompt: " gwtPath
gwtPath=${gwtPath:=$gwtPathDefault}
if [[ ! -f $gwtPath ]]; then
Expand All @@ -73,7 +65,6 @@ read -p"GPG passphrase for jar signing (may skip for local deployment): " gpgPas
gpgPassphrase=${gpgPassphrase:=$GWT_GPG_PASS}

maven-gwt "$gwtVersion" \
"$jsinteropVersion" \
"$gwtPath" \
"$repoUrl" \
"$repoId"
Expand Down
3 changes: 3 additions & 0 deletions user/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
location="${gwt.tools.lib}/hibernate/validator/hibernate-validator-4.1.0.Final-sources.jar"/>
<pathelement
location="${gwt.tools.lib}/streamhtmlparser/streamhtmlparser-jsilver-r10/streamhtmlparser-jsilver-r10-1.5-rebased.jar"/>
<pathelement
location="${gwt.tools.lib}/jsinterop/jsinterop-annotations-2.0.0.jar"/>
<pathelement location="${gwt.dev.jar}"/>
</classpath>
</gwt.javac>
Expand Down Expand Up @@ -206,6 +208,7 @@
<zipfileset
src="${gwt.tools.lib}/streamhtmlparser/streamhtmlparser-jsilver-r10/streamhtmlparser-jsilver-r10-1.5-rebased.jar"/>
<zipfileset src="${gwt.tools.lib}/gss/2015-11-04/closure-stylesheets-library-20151104-rebased.jar"/>
<zipfileset src="${gwt.tools.lib}/jsinterop/jsinterop-annotations-2.0.0.jar"/>
</gwt.jar>
</target>

Expand Down
1 change: 0 additions & 1 deletion user/src/com/google/gwt/core/Core.gwt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<inherits name="com.google.gwt.emul.Emulation" />
<inherits name="com.google.gwt.core.StackTrace" />
<inherits name="com.google.gwt.core.AsyncFragmentLoader" />
<inherits name="jsinterop.annotations.Annotations" />

<source path="client" />
<source path="shared" />
Expand Down
3 changes: 0 additions & 3 deletions user/src/jsinterop/annotations/Annotations.gwt.xml

This file was deleted.

42 changes: 0 additions & 42 deletions user/src/jsinterop/annotations/JsAsync.java

This file was deleted.

37 changes: 0 additions & 37 deletions user/src/jsinterop/annotations/JsConstructor.java

This file was deleted.

91 changes: 0 additions & 91 deletions user/src/jsinterop/annotations/JsEnum.java

This file was deleted.

Loading

0 comments on commit 8188fd9

Please sign in to comment.