Skip to content

Commit

Permalink
fix: починил сборку gradle + обновил gradlew + исправил ошибку с
Browse files Browse the repository at this point in the history
  • Loading branch information
otymko authored and Oleg Tymko committed Oct 22, 2024
1 parent eb1286e commit b62a862
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 157 deletions.
37 changes: 7 additions & 30 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,14 @@ jobs:
- name: Build with Gradle
run: ./gradlew build

- name: Install python lib
run: pip install requests

- name: Download BSL LS
run: |
import requests
import os
import zipfile
import shutil
from urllib.request import urlretrieve
def getUrlDownloadBSL():
url = ""
r = requests.get(
"https://api.github.com/repos/1c-syntax/bsl-language-server/releases/latest")
json = r.json()
for asset in json["assets"]:
if asset["name"] == "bsl-language-server_win.zip":
url = asset["browser_download_url"]
break
return url
bsl_name = "bsl-language-server"
dirName = os.path.join(os.getcwd(), "build", "libs")
url = getUrlDownloadBSL()
tmpfile, headers = urlretrieve(url)
zip = zipfile.ZipFile(tmpfile)
zip.extractall()
shutil.move(os.path.join(os.getcwd(), bsl_name), os.path.join(dirName, bsl_name))
shell: python
uses: robinraju/release-downloader@v1
with:
repository: '1c-syntax/bsl-language-server'
tag: 'v0.23.1'
fileName: 'bsl-language-server_win.zip'
extract: true
out-file-path: 'build/libs/bsl-language-server'

- name: Build msi
run: ./gradlew jpackage
Expand Down
14 changes: 13 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ repositories {

group = "com.github.otymko.phoenixbsl"
version = gitVersionCalculator.calculateVersion("v")

val semver = calculateVersion("v", false)
val javaOptionsForJavaFx = "--add-exports javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED " +
"--add-exports javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED " +
"--add-opens javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED " +
"--add-opens javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED"

dependencies {

Expand Down Expand Up @@ -60,11 +65,17 @@ tasks.jar {
manifest {
attributes["Main-Class"] = mainClass
attributes["Implementation-Version"] = project.version
attributes["Arguments"] = javaOptionsForJavaFx
}

enabled = false
dependsOn(tasks.shadowJar)
}

tasks.withType<JavaExec> {
jvmArgs = javaOptionsForJavaFx.split(" ")
}

tasks.shadowJar {
project.configurations.implementation.get().isCanBeResolved = true
configurations = listOf(project.configurations["implementation"])
Expand All @@ -80,11 +91,12 @@ tasks.register<Exec>("jpackage") {
"--type", "msi",
"--input", "build/libs",
"--main-jar", "phoenix-$version.jar",
"--java-options", javaOptionsForJavaFx,
"--win-dir-chooser",
"--win-shortcut",
"--win-menu",
"--app-version", semver,
"--vendor", "otymko"
"--vendor", "otymko",
)
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit b62a862

Please sign in to comment.