Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 0 additions & 154 deletions build.gradle

This file was deleted.

173 changes: 173 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
import java.util.*

plugins {
java
application
jacoco
id("com.github.breadmoirai.github-release") version "2.5.2"
id("com.github.jarmstrong.buildconfig") version "1.9.0"
id("cloud.rio.license") version "0.18.0"
}

val edtLocation = file(project.properties["EDT_LOCATION"] as String)
println("EDT location: $edtLocation")

repositories {
mavenCentral()
maven("https://jitpack.io")

flatDir {
dirs(edtLocation)
}
}

group = "com.clouds42"
version = "2.7.4"

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

application {
mainClass = "com.clouds42.Coverage41C"
}

dependencies {

compileOnly(
fileTree(edtLocation) {
include("com._1c.g5.v8.dt.debug.*.jar")
}
)

implementation("info.picocli:picocli:4.7.7")

implementation("org.slf4j:slf4j-api:2.0.17")
implementation("org.slf4j:slf4j-simple:2.0.17")

implementation("org.scala-sbt.ipcsocket:ipcsocket:1.6.3")

implementation("org.eclipse.emf:org.eclipse.emf.common:2.44.0")
implementation("org.eclipse.emf:org.eclipse.emf.ecore.xmi:2.39.0")
implementation("org.eclipse.emf:org.eclipse.emf.ecore.xcore.lib:1.7.1")

implementation("org.eclipse.platform:org.eclipse.osgi:3.24.0")
implementation("org.eclipse.platform:org.eclipse.core.runtime:3.34.100")
implementation("org.eclipse.platform:org.eclipse.osgi.services:3.12.300")
implementation("org.eclipse.platform:org.eclipse.equinox.common:3.20.300")

implementation("org.eclipse.jetty:jetty-client:11.0.26")

implementation("com.google.guava:guava:33.5.0-jre")
implementation("com.google.inject:guice:7.0.0")

implementation("de.vandermeer:asciitable:0.3.2") {
exclude("org.apache.commons:commons-lang3")
}

implementation("io.github.1c-syntax:bsl-common-library:0.9.0")
implementation("io.github.1c-syntax:utils:0.6.6")

implementation("io.github.1c-syntax:mdclasses:0.17.0")
implementation("io.github.1c-syntax:bsl-parser:0.29.0") {
exclude("com.ibm.icu", "*")
exclude("org.antlr", "ST4")
exclude("org.antlr", "antlr-runtime")
}

annotationProcessor("info.picocli:picocli-codegen:4.7.7")

testImplementation("org.xmlunit:xmlunit-core:2.11.0")
testImplementation("org.xmlunit:xmlunit-matchers:2.11.0")
testImplementation("com.fasterxml.jackson.core:jackson-core:2.20.1")
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.20.1")

testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.4")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.11.4")
}

buildConfig {
className("BuildConfig")
packageName("com.clouds42")
buildConfigField("String", "APP_VERSION", "\"${project.version}\"")
buildConfigField("long", "BUILD_TIME", "${System.currentTimeMillis()}L")
}

tasks.generateBuildConfig {
dependsOn(tasks.licenseMain)
}

tasks.named("startScripts", CreateStartScripts::class) {
(unixStartScriptGenerator as TemplateBasedScriptGenerator).template =
resources.text.fromFile(file("${project.rootDir.absolutePath}/scripts/unixStartScript.txt"))

(windowsStartScriptGenerator as TemplateBasedScriptGenerator).template =
resources.text.fromFile(file("${project.rootDir.absolutePath}/scripts/windowsStartScript.txt"))
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-Aproject=${project.group}/${project.name}")
classpath += configurations.compileClasspath.get()
}

tasks.test {
classpath += configurations.compileClasspath.get()
useJUnitPlatform()

testLogging {
events("passed", "skipped", "failed", "standard_error")
}

reports {
html.required.set(true)
}

testLogging.showStandardStreams = true
}

tasks.check {
dependsOn(tasks.jacocoTestReport)
}

tasks.jacocoTestReport {
reports {
xml.required.set(true)
xml.outputLocation.set(File("${layout.buildDirectory.get()}/reports/jacoco/test/jacoco.xml"))
}
}

license {
header = rootProject.file("HEADER.txt")
skipExistingHeaders = false
strictCheck = true
mapping("java", "SLASHSTAR_STYLE")

ext["year"] = "2020-" + Calendar.getInstance().get(Calendar.YEAR)
ext["name"] = "Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com>"
ext["project"] = "Coverage41C"
exclude("**/*.properties")
exclude("**/*.xml")
exclude("**/*.json")
exclude("**/*.bsl")
exclude("**/*.os")
exclude("**/*.txt")
exclude("**/*.java.orig")
exclude("**/*.impl")
exclude("**/BuildConfig.java")
exclude("**/test/resources/**/*")
}

tasks.named("run", JavaExec::class) {
classpath += configurations.compileClasspath.get()
}

githubRelease {
token(project.findProperty("github.token")?.toString() ?: "")
owner = "proDOOMman"
repo = "Coverage41C"
targetCommitish = "master"
releaseAssets(tasks.named("distZip"))
dryRun = false
}
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx1024m -XX:MaxMetaspaceSize=512m

EDT_LOCATION=/opt/1C/1CE/components/1c-edt-2024.2.6+7-x86_64/plugins
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "build.gradle.kts" -o -name "build.gradle" | head -20

Repository: 1c-syntax/Coverage41C

Length of output: 83


🏁 Script executed:

rg "EDT_LOCATION" --type gradle --type kotlin -B 3 -A 3

Repository: 1c-syntax/Coverage41C

Length of output: 354


🏁 Script executed:

cat -n .gitignore | grep -E "(gradle\.properties|local\.properties)" || echo "Не найдено совпадений в .gitignore"

Repository: 1c-syntax/Coverage41C

Length of output: 99


🏁 Script executed:

rg "EDT_LOCATION" --type properties -B 2 -A 2

Repository: 1c-syntax/Coverage41C

Length of output: 99


🏁 Script executed:

git ls-files | grep gradle.properties

Repository: 1c-syntax/Coverage41C

Length of output: 82


🏁 Script executed:

cat -n build.gradle.kts | head -50

Repository: 1c-syntax/Coverage41C

Length of output: 1435


🏁 Script executed:

rg "edtLocation" --type kotlin -B 2 -A 5

Repository: 1c-syntax/Coverage41C

Length of output: 911


🏁 Script executed:

cat -n gradle.properties

Repository: 1c-syntax/Coverage41C

Length of output: 245


EDT_LOCATION жестко закодирован и создаст проблемы при локальной разработке

Абсолютный путь /opt/1C/1CE/components/1c-edt-2024.2.6+7-x86_64/plugins используется в build.gradle.kts как:

  • Репозиторий для загрузки артефактов (строка 20)
  • Источник JAR файлов с отладочной информацией (строка 39-41)

Проблемы:

  • Linux-специфичный путь несовместим с Windows
  • Зависит от точной версии EDK (2024.2.6+7)
  • На разных машинах EDK может быть установлен в другое место
  • gradle.properties коммичена в репозиторий, поэтому разработчикам придётся либо менять файл локально, либо использовать переменные окружения (не задокументировано)
  • Сломает сборку в CI/CD и у большинства разработчиков

Рекомендуется:

  1. Переместить gradle.properties в .gitignore и создать gradle.properties.sample как шаблон
  2. Задокументировать способ переопределения: export ORG_GRADLE_PROJECT_EDT_LOCATION=/path/to/edt или gradle -PEDT_LOCATION=/path/to/edt
  3. Добавить обработку ошибки в build.gradle.kts с понятным сообщением если EDT_LOCATION не задан
🤖 Prompt for AI Agents
В файле gradle.properties около строки 4 строка EDT_LOCATION жестко прописывает
Linux-специфичный абсолютный путь; это ломает сборку на других машинах/Windows и
привязывает к конкретной версии. Уберите коммит этого файла (перенесите
gradle.properties в .gitignore), добавьте gradle.properties.sample с ключом
EDT_LOCATION для шаблона, задокументируйте в README как переопределять значение
(export ORG_GRADLE_PROJECT_EDT_LOCATION=/path/to/edt или gradle
-PEDT_LOCATION=/path/to/edt) и измените build.gradle.kts так, чтобы оно
проверяло наличие свойства/переменной и выдавало понятную ошибку с инструкцией
как задать EDT_LOCATION (или поддерживало fallback/OS-agnostic поиск), вместо
использования жестко закодированного пути.

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Tue Mar 17 22:47:19 MSK 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading