From a6ecb8840d83140c7ea705cfd2cbb4b21d92efe5 Mon Sep 17 00:00:00 2001 From: kahverengi Date: Tue, 5 Mar 2024 21:02:10 +0300 Subject: [PATCH] feat: add onLoad method & build with ui task to gradle --- .github/workflows/release.yml | 12 ++++++------ build.gradle.kts | 6 ++++++ src/Component.svelte | 5 +++++ src/main.js | 6 ++++-- 4 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 src/Component.svelte diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e17e313..b2ea6b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,19 +62,19 @@ jobs: distribution: temurin java-version: 8 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "lts/*" + - name: Build with Gradle uses: gradle/actions/setup-gradle@v3 with: arguments: | - build + buildWithUI -Pversion=${{ needs.get-next-version.outputs.new_tag_version }} -PtimeStamp=${{ steps.time.outputs.time }} - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: "lts/*" - - name: Release env: GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} diff --git a/build.gradle.kts b/build.gradle.kts index 5d52a3f..3db4026 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -36,6 +36,12 @@ dependencies { } tasks { + register("buildWithUI", Exec::class) { + commandLine("yarn") + commandLine("yarn", "build") + finalizedBy("build") + } + shadowJar { val pluginId: String by project val pluginClass: String by project diff --git a/src/Component.svelte b/src/Component.svelte new file mode 100644 index 0000000..fa67f8b --- /dev/null +++ b/src/Component.svelte @@ -0,0 +1,5 @@ + + +Hello {name}! \ No newline at end of file diff --git a/src/main.js b/src/main.js index 47b8cc8..a370bdc 100755 --- a/src/main.js +++ b/src/main.js @@ -1,3 +1,5 @@ -export default { - pluginLoaded: true +export {default as test} from "./Component.svelte"; + +export async function onLoad() { + console.log("hello world!") } \ No newline at end of file