Support java 17 sealed classes
This commit is contained in:
parent
c9d501f788
commit
5ed8eaf837
@ -54,10 +54,12 @@ echo "Deleting old data..."
|
|||||||
[ -d ./generated/tdjni_build/ ] && rm -r ./generated/tdjni_build/
|
[ -d ./generated/tdjni_build/ ] && rm -r ./generated/tdjni_build/
|
||||||
[ -d ./generated/tdjni_bin/ ] && rm -r ./generated/tdjni_bin/
|
[ -d ./generated/tdjni_bin/ ] && rm -r ./generated/tdjni_bin/
|
||||||
[ -d ./generated/tdjni_docs/ ] && rm -r ./generated/tdjni_docs/
|
[ -d ./generated/tdjni_docs/ ] && rm -r ./generated/tdjni_docs/
|
||||||
|
[ -f ./generated/src/main/java17/${JAVA_API_PACKAGE_PATH}/TdApi.java ] && rm ./generated/src/main/java17/${JAVA_API_PACKAGE_PATH}/TdApi.java
|
||||||
[ -f ./generated/src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java ] && rm ./generated/src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java
|
[ -f ./generated/src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java ] && rm ./generated/src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java
|
||||||
|
|
||||||
# Create missing folders
|
# Create missing folders
|
||||||
echo "Creating missing folders..."
|
echo "Creating missing folders..."
|
||||||
|
[ -d "./generated/src/main/java17/${JAVA_API_PACKAGE_PATH}/" ] || mkdir -p "./generated/src/main/java17/${JAVA_API_PACKAGE_PATH}/"
|
||||||
[ -d "./generated/src/main/java/${JAVA_API_PACKAGE_PATH}/" ] || mkdir -p "./generated/src/main/java/${JAVA_API_PACKAGE_PATH}/"
|
[ -d "./generated/src/main/java/${JAVA_API_PACKAGE_PATH}/" ] || mkdir -p "./generated/src/main/java/${JAVA_API_PACKAGE_PATH}/"
|
||||||
[ -d "./generated/src/main/java/${JAVA_LIB_PACKAGE_PATH}/" ] || mkdir -p "./generated/src/main/java/${JAVA_LIB_PACKAGE_PATH}/"
|
[ -d "./generated/src/main/java/${JAVA_LIB_PACKAGE_PATH}/" ] || mkdir -p "./generated/src/main/java/${JAVA_LIB_PACKAGE_PATH}/"
|
||||||
[ -d ./generated/tdjni_build/ ] || mkdir ./generated/tdjni_build/
|
[ -d ./generated/tdjni_build/ ] || mkdir ./generated/tdjni_build/
|
||||||
@ -83,18 +85,32 @@ echo "Telegram source path: '$(realpath -m ./implementation/)'"
|
|||||||
echo "Generating TdApi.java..."
|
echo "Generating TdApi.java..."
|
||||||
./td_tools/td/generate/td_generate_java_api TdApi "./implementation/td/generate/scheme/td_api.tlo" "./src/main/java" "$JAVA_API_PACKAGE_PATH"
|
./td_tools/td/generate/td_generate_java_api TdApi "./implementation/td/generate/scheme/td_api.tlo" "./src/main/java" "$JAVA_API_PACKAGE_PATH"
|
||||||
php ./implementation/td/generate/JavadocTlDocumentationGenerator.php "./implementation/td/generate/scheme/td_api.tl" "./src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java"
|
php ./implementation/td/generate/JavadocTlDocumentationGenerator.php "./implementation/td/generate/scheme/td_api.tl" "./src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java"
|
||||||
|
mv "./src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java" "./src/main/java/${JAVA_API_PACKAGE_PATH}/php_TdApi.java"
|
||||||
|
|
||||||
echo "Patching TdApi.java..."
|
echo "Patching TdApi.java for Java 17..."
|
||||||
${PYTHON_EXECUTABLE} ../scripts/core/tdlib-serializer "$(realpath -m ./src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java)" "$(realpath -m ./src/main/java/${JAVA_API_PACKAGE_PATH}/new_TdApi.java)" "$(realpath -m ../scripts/core/tdlib-serializer/headers.txt)"
|
${PYTHON_EXECUTABLE} ../scripts/core/tdlib-serializer "$(realpath -m ./src/main/java/${JAVA_API_PACKAGE_PATH}/php_TdApi.java)" "$(realpath -m ./src/main/java17/${JAVA_API_PACKAGE_PATH}/unexpanded_TdApi.java)" "$(realpath -m ../scripts/core/tdlib-serializer/headers.txt)" true
|
||||||
rm ./src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java
|
|
||||||
if [[ "$OPERATING_SYSTEM_NAME" == "osx" ]]; then
|
if [[ "$OPERATING_SYSTEM_NAME" == "osx" ]]; then
|
||||||
unexpand --tabs=2 ./src/main/java/${JAVA_API_PACKAGE_PATH}/new_TdApi.java > ./src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java
|
unexpand --tabs=2 ./src/main/java17/${JAVA_API_PACKAGE_PATH}/unexpanded_TdApi.java > ./src/main/java17/${JAVA_API_PACKAGE_PATH}/TdApi.java
|
||||||
else
|
else
|
||||||
unexpand -t 2 ./src/main/java/${JAVA_API_PACKAGE_PATH}/new_TdApi.java > ./src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java
|
unexpand -t 2 ./src/main/java17/${JAVA_API_PACKAGE_PATH}/unexpanded_TdApi.java > ./src/main/java17/${JAVA_API_PACKAGE_PATH}/TdApi.java
|
||||||
fi
|
fi
|
||||||
rm ./src/main/java/${JAVA_API_PACKAGE_PATH}/new_TdApi.java
|
rm ./src/main/java17/${JAVA_API_PACKAGE_PATH}/unexpanded_TdApi.java
|
||||||
|
|
||||||
echo "Generated '$(realpath -m ./src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java)'"
|
echo "Generated '$(realpath -m ./src/main/java17/${JAVA_API_PACKAGE_PATH}/TdApi.java)'"
|
||||||
|
|
||||||
|
echo "Patching TdApi.java for Java 8..."
|
||||||
|
${PYTHON_EXECUTABLE} ../scripts/core/tdlib-serializer "$(realpath -m ./src/main/java/${JAVA_API_PACKAGE_PATH}/php_TdApi.java)" "$(realpath -m ./src/main/java/${JAVA_API_PACKAGE_PATH}/unexpanded_TdApi.java)" "$(realpath -m ../scripts/core/tdlib-serializer/headers.txt)" false
|
||||||
|
if [[ "$OPERATING_SYSTEM_NAME" == "osx" ]]; then
|
||||||
|
unexpand --tabs=2 ./src/main/java/${JAVA_API_PACKAGE_PATH}/unexpanded_TdApi.java > ./src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java
|
||||||
|
else
|
||||||
|
unexpand -t 2 ./src/main/java/${JAVA_API_PACKAGE_PATH}/unexpanded_TdApi.java > ./src/main/java/${JAVA_API_PACKAGE_PATH}/TdApi.java
|
||||||
|
fi
|
||||||
|
rm ./src/main/java/${JAVA_API_PACKAGE_PATH}/unexpanded_TdApi.java
|
||||||
|
|
||||||
|
echo "Generated '$(realpath -m ./src/main/java17/${JAVA_API_PACKAGE_PATH}/TdApi.java)'"
|
||||||
|
|
||||||
|
|
||||||
|
rm ./src/main/java/${JAVA_API_PACKAGE_PATH}/php_TdApi.java
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 599c05f320898f37bd9e52f917ae4bcb2ecc2f2b
|
Subproject commit 36f96dfaf59b8add1813d57cc12467ae8eef55f0
|
@ -134,6 +134,20 @@
|
|||||||
<release>9</release>
|
<release>9</release>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<!-- compile sources with Java 17 -->
|
||||||
|
<execution>
|
||||||
|
<id>java-17-module-compile</id>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<release>17</release>
|
||||||
|
<compileSourceRoots>
|
||||||
|
<compileSourceRoot>${project.basedir}/src/main/java17</compileSourceRoot>
|
||||||
|
</compileSourceRoots>
|
||||||
|
<multiReleaseOutput>true</multiReleaseOutput>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
<!-- compile sources with Java 9 to generate and validate module-info.java -->
|
<!-- compile sources with Java 9 to generate and validate module-info.java -->
|
||||||
<execution>
|
<execution>
|
||||||
<id>java-9-module-compile</id>
|
<id>java-9-module-compile</id>
|
||||||
|
Loading…
Reference in New Issue
Block a user