Skip to content

Commit

Permalink
fix: ошибка сборки gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
otymko authored Oct 23, 2024
2 parents eb1286e + 8d4b6c2 commit c041943
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 162 deletions.
37 changes: 8 additions & 29 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,16 @@ 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")
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'

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
- run: del ./build/libs/bsl-language-server_win.zip

- name: Build msi
run: ./gradlew jpackage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
java-version: 17
- name: SonarCloud Scan
run: ./gradlew check sonarqube
run: ./gradlew check sonar
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
jacoco
id("org.openjfx.javafxplugin") version "0.0.10"
id("com.github.johnrengelman.shadow") version "7.0.0"
id("org.sonarqube") version "3.3"
id("org.sonarqube") version "5.1.0.4882"
id("io.franzbecker.gradle-lombok") version "4.0.0"
id("com.github.gradle-git-version-calculator") version "1.1.0"
}
Expand All @@ -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,19 +91,20 @@ 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",
)
}

sonarqube {
sonar {
properties {
property("sonar.sourceEncoding", "UTF-8")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.organization", "phoenixbsl")
property("sonar.organization", "otymko ")
property("sonar.projectKey", "phoenixbsl")
property("sonar.projectName", "Phoenix BSL")
property("sonar.exclusions", "**/gen/**/*.*")
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 c041943

Please sign in to comment.