Skip to content

Commit

Permalink
Added a MANIFEST file to JCEF JARs (fixes issue chromiumembedded#389)
Browse files Browse the repository at this point in the history
This manifest file contains the Automatic-Module-Name set to "jcef". This helps improve compatibility with JPMS (Java 9 Module System), and avoids having two different modules for win32 and win64 JCEF.
  • Loading branch information
HarmfulBreeze authored and magreenblatt committed Dec 20, 2021
1 parent 84f7798 commit 11fa85f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

<target name="jar" depends="compile">
<mkdir dir="${out.path}"/>
<jar destfile="${out.path}/jcef.jar" index="true" update="false">
<jar destfile="${out.path}/jcef.jar" index="true" update="false" manifest="java/manifest/MANIFEST.MF">
<fileset dir="${out.path}">
<include name="org/cef/**"/>
</fileset>
Expand Down
2 changes: 2 additions & 0 deletions java/manifest/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Manifest-Version: 1.0
Automatic-Module-Name: jcef
3 changes: 3 additions & 0 deletions tools/compile.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ set CLS_PATH=".\third_party\jogamp\jar\*;.\third_party\junit\*;.\java"
if not exist %OUT_PATH% mkdir %OUT_PATH%
javac -Xdiags:verbose -cp %CLS_PATH% -d %OUT_PATH% java/tests/detailed/*.java java/tests/junittests/*.java java/tests/simple/*.java java/org/cef/*.java java/org/cef/browser/*.java java/org/cef/callback/*.java java/org/cef/handler/*.java java/org/cef/misc/*.java java/org/cef/network/*.java

:: Copy MANIFEST.MF
xcopy /sfy .\java\manifest %OUT_PATH%\manifest\

:: Copy resource files.
xcopy /sfy .\java\tests\detailed\handler\*.html %OUT_PATH%\tests\detailed\handler\
xcopy /sfy .\java\tests\detailed\handler\*.png %OUT_PATH%\tests\detailed\handler\
Expand Down
3 changes: 3 additions & 0 deletions tools/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ else

javac -Xdiags:verbose -cp "$CLS_PATH" -d "$OUT_PATH" "${JAVA_PATH}"/tests/detailed/*.java "${JAVA_PATH}"/tests/junittests/*.java "${JAVA_PATH}"/tests/simple/*.java "${JAVA_PATH}"/org/cef/*.java "${JAVA_PATH}"/org/cef/browser/*.java "${JAVA_PATH}"/org/cef/callback/*.java "${JAVA_PATH}"/org/cef/handler/*.java "${JAVA_PATH}"/org/cef/misc/*.java "${JAVA_PATH}"/org/cef/network/*.java

# Copy MANIFEST.MF
rsync -a ./java/manifest/MANIFEST.MF $OUT_PATH/manifest/

# Copy resource files.
cp -f "${JAVA_PATH}"/tests/detailed/handler/*.html "$OUT_PATH/tests/detailed/handler"
cp -f "${JAVA_PATH}"/tests/detailed/handler/*.png "$OUT_PATH/tests/detailed/handler"
Expand Down
2 changes: 1 addition & 1 deletion tools/make_jar.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set ERRORLEVEL=1
goto end
)
cd ..\out\%1
jar -cf jcef.jar org/cef/*.class org/cef/browser/*.class org/cef/callback/*.class org/cef/handler/*.class org/cef/misc/*.class org/cef/network/*.class
jar -cmf manifest\MANIFEST.MF jcef.jar org/cef/*.class org/cef/browser/*.class org/cef/callback/*.class org/cef/handler/*.class org/cef/misc/*.class org/cef/network/*.class
jar -cf jcef-tests.jar tests/detailed/*.class tests/detailed/dialog/*.class tests/detailed/handler/* tests/detailed/ui/*.class

:end
Expand Down
2 changes: 1 addition & 1 deletion tools/make_jar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ if [ -z "$1" ]; then
else
DIR="$( cd "$( dirname "$0" )" && cd .. && pwd )"
OUT_DIR="${DIR}/out/$1"
jar -cf "${OUT_DIR}"/jcef.jar -C "${OUT_DIR}" org
jar -cmf "${OUT_DIR}"/manifest/MANIFEST.MF "${OUT_DIR}"/jcef.jar -C "${OUT_DIR}" org
jar -cf "${OUT_DIR}"/jcef-tests.jar -C "${OUT_DIR}" tests
fi

0 comments on commit 11fa85f

Please sign in to comment.