From 8014c038c0090540bda5e9f294904f72c4a11edb Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 3 Jan 2023 15:29:13 +0100 Subject: [PATCH] Migrate to gradle --- .gitignore | 6 + .idea/codeStyles/Project.xml | 3 + .idea/runConfigurations/build.xml | 23 + .idea/runConfigurations/build_samples.xml | 23 + .idea/runConfigurations/publish_locally.xml | 23 + .idea/runConfigurations/run_tests__wasi_.xml | 2 +- README.md | 36 +- all-deps/all-deps.iml | 29 -- build-logic/build.gradle.kts | 90 ++++ .../settings.gradle.kts | 22 +- .../DependencyRelocationExtension.java | 28 + .../DependencyRelocationExtensionImpl.java | 274 ++++++++++ .../DependencyRelocationLibrary.java | 20 + .../buildutil/DependencyRelocationPlugin.java | 27 + .../org/teavm/buildutil/MavenArtifact.java | 30 ++ .../buildutil/MavenPluginDescriptorTask.java | 115 +++++ .../teavm/buildutil/MavenPluginPlugin.java | 73 +++ .../buildutil/PublishTeaVMExtension.java | 22 + .../teavm/buildutil/PublishTeaVMPlugin.java | 93 ++++ .../teavm/buildutil/ShadowApplyPlugin.java | 27 + build.gradle.kts | 17 + classlib/build.gradle.kts | 61 +++ classlib/pom.xml | 175 ------- .../classlib/java/util/regex/TMatcher.java | 27 - .../classlib/java/util/regex/TPattern.java | 30 -- .../main/java/org/threeten/bp/OffsetTime.java | 2 +- .../main/java/org/threeten/bp/ZoneOffset.java | 4 +- .../org/threeten/bp/temporal/WeekFields.java | 2 +- .../java/org/threeten/bp/zone/ZoneRules.java | 8 +- .../checkstyle/checkstyle.xml | 0 .../checkstyle/license-regexp.txt | 0 core/build.gradle.kts | 40 ++ core/pom.xml | 159 ------ .../java/org/teavm/vm/TeaVMPluginReader.java | 8 +- .../org/teavm/backend/wasm/wasm-runtime.js | 2 +- deploy-settings.xml | 28 - deploy.sh | 30 +- extras-slf4j/build.gradle.kts | 33 ++ extras-slf4j/pom.xml | 68 --- gradle.properties | 25 + gradle/libs.versions.toml | 74 +++ .../wrapper/gradle-wrapper.jar | Bin .../wrapper/gradle-wrapper.properties | 0 tools/idea/gradlew => gradlew | 0 tools/idea/gradlew.bat => gradlew.bat | 0 html4j/pom.xml | 133 ----- interop/core/build.gradle.kts | 26 + interop/core/pom.xml | 57 --- jso/apis/build.gradle.kts | 36 ++ jso/apis/pom.xml | 81 --- jso/core/build.gradle.kts | 35 ++ jso/core/pom.xml | 78 --- jso/impl/build.gradle.kts | 34 ++ jso/impl/pom.xml | 100 ---- metaprogramming/api/build.gradle.kts | 35 ++ metaprogramming/api/pom.xml | 73 --- metaprogramming/impl/build.gradle.kts | 34 ++ metaprogramming/impl/pom.xml | 117 ----- platform/build.gradle.kts | 34 ++ platform/pom.xml | 68 --- .../platform/metadata/MetadataGenerator.java | 37 -- .../metadata/MetadataGeneratorContext.java | 17 - pom.xml | 480 ------------------ samples/async/build.gradle.kts | 40 ++ samples/async/pom.xml | 92 ---- .../org/teavm/samples/async/AsyncProgram.java | 26 +- samples/async/src/main/webapp/index.html | 2 +- samples/benchmark/.gitignore | 1 + samples/benchmark/CMakeLists.txt | 4 +- samples/benchmark/README.md | 17 +- samples/benchmark/build-native.sh | 20 + samples/benchmark/build.gradle.kts | 81 +++ samples/benchmark/pom.xml | 250 --------- .../benchmark/htmljava/BenchmarkStarter.java | 127 ----- samples/benchmark/src/main/webapp/index.html | 7 +- .../benchmark/src/main/webapp/teavm-wasm.html | 2 +- .../benchmark/src/main/webapp/teavm-wasm.js | 4 +- samples/benchmark/src/main/webapp/teavm.html | 2 +- samples/build.gradle.kts | 21 + samples/gamepad/pom.xml | 106 ---- samples/gradle.properties | 17 + samples/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 60756 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + samples/gradlew | 240 +++++++++ samples/gradlew.bat | 91 ++++ samples/hello/build.gradle.kts | 31 ++ samples/hello/pom.xml | 105 ---- .../java/org/teavm/samples/hello/Server.java | 7 +- samples/hello/src/main/webapp/index.html | 2 +- .../java/org.teavm.samples.hello}/Client.java | 4 +- samples/kotlin/build.gradle.kts | 30 ++ samples/kotlin/pom.xml | 129 ----- .../org/teavm/samples/kotlin/ConsoleHello.kt | 2 +- .../kotlin/org/teavm/samples/kotlin/Hello.kt | 2 +- samples/kotlin/src/main/webapp/index.html | 2 +- samples/pi/CMakeLists.txt | 16 + samples/pi/build-native.sh | 20 + samples/pi/build.gradle.kts | 64 +++ .../org/teavm/samples/pi/PiCalculator.java | 154 ++++++ samples/pi/src/main/webapp/index.html | 29 ++ .../src/main/webapp/js.html} | 45 +- samples/pi/src/main/webapp/wasm.html | 67 +++ samples/pom.xml | 42 -- samples/scala/build.gradle.kts | 31 ++ samples/scala/pom.xml | 104 ---- samples/scala/src/main/webapp/index.html | 2 +- .../org/teavm/samples/scala/Calculator.scala | 16 + .../org/teavm/samples/scala/Client.scala | 0 .../org/teavm/samples/scala/Grammar.scala | 0 samples/settings.gradle.kts | 93 ++++ samples/stdout-helper/build.gradle.kts | 25 + .../src/main/webapp/teavm/stdout.js | 5 +- samples/storage/build.gradle.kts | 30 ++ samples/storage/pom.xml | 106 ---- samples/storage/src/main/webapp/index.html | 2 +- samples/video/build.gradle.kts | 30 ++ samples/video/pom.xml | 105 ---- samples/video/src/main/webapp/index.html | 2 +- settings.gradle.kts | 127 +++++ tests/build.gradle.kts | 51 ++ tests/pom.xml | 154 ------ .../org/teavm/dependency/ClassValueTest.java | 2 +- tools/c-incremental/build.gradle.kts | 31 ++ tools/c-incremental/pom.xml | 91 ---- tools/chrome-rdp/build.gradle.kts | 36 ++ tools/chrome-rdp/pom.xml | 85 ---- .../classlib-comparison-gen/build.gradle.kts | 27 + tools/classlib-comparison-gen/pom.xml | 101 ---- .../JCLComparisonBuilder.java | 53 +- .../JCLComparisonVisitor.java | 3 +- tools/cli/build.gradle.kts | 47 ++ tools/cli/pom.xml | 170 ------- tools/core/build.gradle.kts | 35 ++ tools/core/pom.xml | 113 ----- tools/deobfuscator-js/build.gradle.kts | 76 +++ .../tooling/deobfuscate/js/Compiler.java | 47 ++ .../deobfuscate/js/DeobfuscateFunction.java | 0 .../tooling/deobfuscate/js/Deobfuscator.java | 0 .../deobfuscate/js/DeobfuscatorCallback.java | 0 .../deobfuscate/js/DeobfuscatorJs.java | 0 .../deobfuscate/js/DeobfuscatorLib.java | 0 .../teavm/tooling/deobfuscate/js/Frame.java | 0 .../deobfuscate/js/Int8ArrayInputStream.java | 0 tools/devserver/build.gradle.kts | 54 ++ tools/devserver/pom.xml | 155 ------ tools/eclipse/core-plugin/dep-pom.xml | 115 ----- tools/eclipse/core-plugin/pom.xml | 60 --- tools/eclipse/feature/pom.xml | 42 -- tools/eclipse/m2e-feature/pom.xml | 37 -- tools/eclipse/m2e-plugin/pom.xml | 41 -- tools/eclipse/plugin/pom.xml | 41 -- tools/eclipse/pom.xml | 108 ---- tools/eclipse/updatesite/pom.xml | 42 -- tools/gradle/build.gradle.kts | 111 ++++ .../java/org/teavm/gradle/GenerateCTask.java | 58 +++ .../teavm/gradle/GenerateJavaScriptTask.java | 56 ++ .../org/teavm/gradle/GenerateWasiTask.java | 43 ++ .../org/teavm/gradle/GenerateWasmTask.java | 43 ++ .../org/teavm/gradle/GradleTeaVMToolLog.java | 67 +++ .../org/teavm/gradle/OptimizationLevel.java | 22 + .../org/teavm/gradle/TeaVMBaseExtension.java | 24 + .../teavm/gradle/TeaVMBaseExtensionImpl.java | 105 ++++ .../org/teavm/gradle/TeaVMCConfiguration.java | 26 + .../gradle/TeaVMCommonConfiguration.java | 41 ++ .../org/teavm/gradle/TeaVMConfiguration.java | 24 + .../java/org/teavm/gradle/TeaVMExtension.java | 40 ++ .../org/teavm/gradle/TeaVMExtensionImpl.java | 166 ++++++ .../teavm/gradle/TeaVMJSConfiguration.java | 30 ++ .../java/org/teavm/gradle/TeaVMLibraries.java | 28 + .../org/teavm/gradle/TeaVMLibraryPlugin.java | 40 ++ .../gradle/TeaVMNativeBaseConfiguration.java | 24 + .../java/org/teavm/gradle/TeaVMPlugin.java | 213 ++++++++ .../main/java/org/teavm/gradle/TeaVMTask.java | 192 +++++++ .../teavm/gradle/TeaVMWasiConfiguration.java | 19 + .../gradle/TeaVMWasmBaseConfiguration.java | 22 + .../teavm/gradle/TeaVMWasmConfiguration.java | 19 + .../teavm/gradle/TeaVMWebConfiguration.java | 22 + tools/ide-deps/build.gradle.kts | 34 ++ tools/ide-deps/pom.xml | 113 ----- tools/idea/.gitignore | 5 - tools/idea/build.gradle.kts | 42 +- tools/idea/settings.gradle.kts | 1 - .../main/java/org/teavm/idea/DaemonUtil.java | 3 +- .../src/main/resources/META-INF/plugin.xml | 5 - tools/junit/build.gradle.kts | 62 +++ tools/junit/pom.xml | 188 ------- .../org/teavm/junit/BrowserRunStrategy.java | 2 +- tools/maven/plugin/build.gradle.kts | 32 ++ tools/maven/plugin/pom.xml | 113 ----- tools/maven/plugin/src/test/java/.gitignore | 0 .../plugin/src/test/resources/.gitignore | 0 tools/maven/pom.xml | 38 -- tools/maven/webapp/build.gradle.kts | 33 ++ tools/maven/webapp/pom.xml | 60 --- .../resources/archetype-resources/pom.xml | 2 +- .../src/main/java/Client.java | 7 +- 196 files changed, 4804 insertions(+), 5006 deletions(-) create mode 100644 .idea/runConfigurations/build.xml create mode 100644 .idea/runConfigurations/build_samples.xml create mode 100644 .idea/runConfigurations/publish_locally.xml delete mode 100644 all-deps/all-deps.iml create mode 100644 build-logic/build.gradle.kts rename samples/benchmark/src/main/java/org/teavm/samples/benchmark/htmljava/BenchmarkFX.java => build-logic/settings.gradle.kts (57%) create mode 100644 build-logic/src/main/java/org/teavm/buildutil/DependencyRelocationExtension.java create mode 100644 build-logic/src/main/java/org/teavm/buildutil/DependencyRelocationExtensionImpl.java create mode 100644 build-logic/src/main/java/org/teavm/buildutil/DependencyRelocationLibrary.java create mode 100644 build-logic/src/main/java/org/teavm/buildutil/DependencyRelocationPlugin.java create mode 100644 build-logic/src/main/java/org/teavm/buildutil/MavenArtifact.java create mode 100644 build-logic/src/main/java/org/teavm/buildutil/MavenPluginDescriptorTask.java create mode 100644 build-logic/src/main/java/org/teavm/buildutil/MavenPluginPlugin.java create mode 100644 build-logic/src/main/java/org/teavm/buildutil/PublishTeaVMExtension.java create mode 100644 build-logic/src/main/java/org/teavm/buildutil/PublishTeaVMPlugin.java create mode 100644 build-logic/src/main/java/org/teavm/buildutil/ShadowApplyPlugin.java create mode 100644 build.gradle.kts create mode 100644 classlib/build.gradle.kts delete mode 100644 classlib/pom.xml rename checkstyle.xml => config/checkstyle/checkstyle.xml (100%) rename license-regexp.txt => config/checkstyle/license-regexp.txt (100%) create mode 100644 core/build.gradle.kts delete mode 100644 core/pom.xml delete mode 100644 deploy-settings.xml create mode 100644 extras-slf4j/build.gradle.kts delete mode 100644 extras-slf4j/pom.xml create mode 100644 gradle.properties create mode 100644 gradle/libs.versions.toml rename {tools/idea/gradle => gradle}/wrapper/gradle-wrapper.jar (100%) rename {tools/idea/gradle => gradle}/wrapper/gradle-wrapper.properties (100%) rename tools/idea/gradlew => gradlew (100%) rename tools/idea/gradlew.bat => gradlew.bat (100%) delete mode 100644 html4j/pom.xml create mode 100644 interop/core/build.gradle.kts delete mode 100644 interop/core/pom.xml create mode 100644 jso/apis/build.gradle.kts delete mode 100644 jso/apis/pom.xml create mode 100644 jso/core/build.gradle.kts delete mode 100644 jso/core/pom.xml create mode 100644 jso/impl/build.gradle.kts delete mode 100644 jso/impl/pom.xml create mode 100644 metaprogramming/api/build.gradle.kts delete mode 100644 metaprogramming/api/pom.xml create mode 100644 metaprogramming/impl/build.gradle.kts delete mode 100644 metaprogramming/impl/pom.xml create mode 100644 platform/build.gradle.kts delete mode 100644 platform/pom.xml delete mode 100644 pom.xml create mode 100644 samples/async/build.gradle.kts delete mode 100644 samples/async/pom.xml create mode 100644 samples/benchmark/.gitignore create mode 100755 samples/benchmark/build-native.sh create mode 100644 samples/benchmark/build.gradle.kts delete mode 100644 samples/benchmark/pom.xml delete mode 100644 samples/benchmark/src/main/java/org/teavm/samples/benchmark/htmljava/BenchmarkStarter.java create mode 100644 samples/build.gradle.kts delete mode 100644 samples/gamepad/pom.xml create mode 100644 samples/gradle.properties create mode 100644 samples/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/gradle/wrapper/gradle-wrapper.properties create mode 100755 samples/gradlew create mode 100644 samples/gradlew.bat create mode 100644 samples/hello/build.gradle.kts delete mode 100644 samples/hello/pom.xml rename samples/hello/src/{main/java/org/teavm/samples/hello => teavm/java/org.teavm.samples.hello}/Client.java (94%) create mode 100644 samples/kotlin/build.gradle.kts delete mode 100644 samples/kotlin/pom.xml create mode 100644 samples/pi/CMakeLists.txt create mode 100755 samples/pi/build-native.sh create mode 100644 samples/pi/build.gradle.kts create mode 100644 samples/pi/src/main/java/org/teavm/samples/pi/PiCalculator.java create mode 100644 samples/pi/src/main/webapp/index.html rename samples/{benchmark/src/main/webapp/bck2brwsr.html => pi/src/main/webapp/js.html} (50%) create mode 100644 samples/pi/src/main/webapp/wasm.html delete mode 100644 samples/pom.xml create mode 100644 samples/scala/build.gradle.kts delete mode 100644 samples/scala/pom.xml rename samples/scala/src/{main => teavm}/scala/org/teavm/samples/scala/Calculator.scala (78%) rename samples/scala/src/{main => teavm}/scala/org/teavm/samples/scala/Client.scala (100%) rename samples/scala/src/{main => teavm}/scala/org/teavm/samples/scala/Grammar.scala (100%) create mode 100644 samples/settings.gradle.kts create mode 100644 samples/stdout-helper/build.gradle.kts rename samples/{async => stdout-helper}/src/main/webapp/teavm/stdout.js (85%) create mode 100644 samples/storage/build.gradle.kts delete mode 100644 samples/storage/pom.xml create mode 100644 samples/video/build.gradle.kts delete mode 100644 samples/video/pom.xml create mode 100644 settings.gradle.kts create mode 100644 tests/build.gradle.kts delete mode 100644 tests/pom.xml create mode 100644 tools/c-incremental/build.gradle.kts delete mode 100644 tools/c-incremental/pom.xml create mode 100644 tools/chrome-rdp/build.gradle.kts delete mode 100644 tools/chrome-rdp/pom.xml create mode 100644 tools/classlib-comparison-gen/build.gradle.kts delete mode 100644 tools/classlib-comparison-gen/pom.xml create mode 100644 tools/cli/build.gradle.kts delete mode 100644 tools/cli/pom.xml create mode 100644 tools/core/build.gradle.kts delete mode 100644 tools/core/pom.xml create mode 100644 tools/deobfuscator-js/build.gradle.kts create mode 100644 tools/deobfuscator-js/src/main/java/org/teavm/tooling/deobfuscate/js/Compiler.java rename tools/{core => deobfuscator-js}/src/main/java/org/teavm/tooling/deobfuscate/js/DeobfuscateFunction.java (100%) rename tools/{core => deobfuscator-js}/src/main/java/org/teavm/tooling/deobfuscate/js/Deobfuscator.java (100%) rename tools/{core => deobfuscator-js}/src/main/java/org/teavm/tooling/deobfuscate/js/DeobfuscatorCallback.java (100%) rename tools/{core => deobfuscator-js}/src/main/java/org/teavm/tooling/deobfuscate/js/DeobfuscatorJs.java (100%) rename tools/{core => deobfuscator-js}/src/main/java/org/teavm/tooling/deobfuscate/js/DeobfuscatorLib.java (100%) rename tools/{core => deobfuscator-js}/src/main/java/org/teavm/tooling/deobfuscate/js/Frame.java (100%) rename tools/{core => deobfuscator-js}/src/main/java/org/teavm/tooling/deobfuscate/js/Int8ArrayInputStream.java (100%) create mode 100644 tools/devserver/build.gradle.kts delete mode 100644 tools/devserver/pom.xml delete mode 100644 tools/eclipse/core-plugin/dep-pom.xml delete mode 100644 tools/eclipse/core-plugin/pom.xml delete mode 100644 tools/eclipse/feature/pom.xml delete mode 100644 tools/eclipse/m2e-feature/pom.xml delete mode 100644 tools/eclipse/m2e-plugin/pom.xml delete mode 100644 tools/eclipse/plugin/pom.xml delete mode 100644 tools/eclipse/pom.xml delete mode 100644 tools/eclipse/updatesite/pom.xml create mode 100644 tools/gradle/build.gradle.kts create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/GenerateCTask.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/GenerateJavaScriptTask.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/GenerateWasiTask.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/GenerateWasmTask.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/GradleTeaVMToolLog.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/OptimizationLevel.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMBaseExtension.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMBaseExtensionImpl.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMCConfiguration.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMCommonConfiguration.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMConfiguration.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMExtension.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMExtensionImpl.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMJSConfiguration.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMLibraries.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMLibraryPlugin.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMNativeBaseConfiguration.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMPlugin.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMTask.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMWasiConfiguration.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMWasmBaseConfiguration.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMWasmConfiguration.java create mode 100644 tools/gradle/src/main/java/org/teavm/gradle/TeaVMWebConfiguration.java create mode 100644 tools/ide-deps/build.gradle.kts delete mode 100644 tools/ide-deps/pom.xml delete mode 100644 tools/idea/.gitignore delete mode 100644 tools/idea/settings.gradle.kts create mode 100644 tools/junit/build.gradle.kts delete mode 100644 tools/junit/pom.xml create mode 100644 tools/maven/plugin/build.gradle.kts delete mode 100644 tools/maven/plugin/pom.xml delete mode 100644 tools/maven/plugin/src/test/java/.gitignore delete mode 100644 tools/maven/plugin/src/test/resources/.gitignore delete mode 100644 tools/maven/pom.xml create mode 100644 tools/maven/webapp/build.gradle.kts delete mode 100644 tools/maven/webapp/pom.xml diff --git a/.gitignore b/.gitignore index 9af71dc1f..ac819be6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,14 @@ # output dir target +build /build-dir /build-cache /deploy-with-env.sh +/.gradle +/build-logic/.gradle +/relocated +/samples/.gradle +local.properties # KDE .directory diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index e941aa391..180bb913f 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -13,6 +13,9 @@ + +