Skip to content
Draft
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ https://42clouds.com/ru-ru/techdocs/raschyot-pokrytiya-koda-1C-testami.html

путём ручного зарпуска дебаг сервера dbgs.exe (например так: ```dbgs.exe --addr=127.0.0.1 --port=1550```), к которому будет подключаться Coverage41C и клиент файловой базы (запущенный с флагами ```/debug -http -attach /debuggerURL «адрес отладчика»``` или через меню "Настройка->Параметры->Сервер отладки" в самом клиенте), см. https://its.1c.ru/db/v837doc#bookmark:adm:TI000000495

*Примечание: если включить протокол отладки http через конфигуратор Сервис -> Параметры -> Отладка, то Coverage41C не сможет подключиться к серверу отладки, т.к. одновременно к информационной базе может быть подключен только один интерфей отладки.*
*Примечание: если включить протокол отладки http через конфигуратор Сервис -> Параметры -> Отладка, то Coverage41C не сможет подключиться к серверу отладки, т.к. одновременно к информационной базе может быть подключен только один интерфейс отладки.*

3) Проверяем что сервер отладки dbgs.exe (https://its.1c.ru/db/edtdoc/content/197/hdoc/_top/dbgs) запустился и работает. Для этого в браузере открываем его, адрес по умолчанию http://127.0.0.1:1550/. В случае успеха выдолжны увидеть сообщение "... it works!".
4) Выгружаем исходники конфигурации, расширения или внешней обработки в файлы (если у вас проекта EDT, то этот шаг пропускаем - он и так хранится в файлах)
Expand Down
50 changes: 25 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group 'com.clouds42'
version '2.5.2'
version '2.7.1'

sourceCompatibility = 11

Expand All @@ -20,7 +20,7 @@ repositories {


configurations {
providedCompile
providedRuntime
}

dependencies {
Expand All @@ -39,36 +39,36 @@ dependencies {
}
println 'EDT location: ' + edtLocation

compile group: 'info.picocli', name: 'picocli', version: '4.6.1'
annotationProcessor 'info.picocli:picocli-codegen:4.6.1'
compile group: 'info.picocli', name: 'picocli', version: '4.6.3'
annotationProcessor 'info.picocli:picocli-codegen:4.6.2'

compile group: 'org.slf4j', name: 'slf4j-api', version: '2.0.0-alpha1'
compile group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.0-alpha1'

compile group: 'org.scala-sbt.ipcsocket', name: 'ipcsocket', version: '1.4.0'

compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.common', version: '2.16.0'
compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.common', version: '2.23.0'
compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.ecore.xmi', version: '2.16.0'
compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.ecore.xcore.lib', version: '1.4.0'
compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.ecore.xcore.lib', version: '1.6.0'

compile group: 'org.eclipse.platform', name: 'org.eclipse.osgi', version: '3.15.300'
compile group: 'org.eclipse.platform', name: 'org.eclipse.osgi', version: '3.17.100'

compile group: 'org.eclipse.platform', name: 'org.eclipse.core.runtime', version: '3.15.300'
compile group: 'org.eclipse.platform', name: 'org.eclipse.osgi.services', version: '3.8.0'
compile group: 'org.eclipse.platform', name: 'org.eclipse.equinox.common', version: '3.10.400'
compile group: 'org.eclipse.platform', name: 'org.eclipse.core.runtime', version: '3.24.0'
compile group: 'org.eclipse.platform', name: 'org.eclipse.osgi.services', version: '3.10.200'
compile group: 'org.eclipse.platform', name: 'org.eclipse.equinox.common', version: '3.15.100'


compile group: 'org.eclipse.jetty', name: 'jetty-client', version: '9.4.27.v20200227'
compile group: 'org.eclipse.jetty', name: 'jetty-client', version: '11.0.6'

compile group: 'com.google.guava', name: 'guava', version: '29.0-jre'
compile group: 'com.google.guava', name: 'guava', version: '31.0.1-jre'

compile group: 'com.google.inject', name: 'guice', version: '4.0'
compile group: 'com.google.inject', name: 'guice', version: '5.1.0'

compile group: 'de.vandermeer', name:'asciitable', version: '0.3.2'

implementation 'com.github.1c-syntax:mdclasses:a5ce5cd5439201040caf27fdc8e4763a7f45f65c'
implementation 'com.github.1c-syntax:mdclasses:0.9.3'

implementation('com.github.1c-syntax:bsl-parser:0.19.3') {
implementation('com.github.1c-syntax:bsl-parser:0.20.3') {
exclude group: "com.tunnelvisionlabs", module: "antlr4-annotations"
exclude group: "com.ibm.icu", module: "*"
exclude group: "org.antlr", module: "ST4"
Expand All @@ -77,29 +77,29 @@ dependencies {
exclude group: "org.glassfish", module: "javax.json"
}

providedCompile fileTree(edtLocation) { include 'com._1c.g5.v8.dt.debug.*.jar' }
providedRuntime fileTree(edtLocation) { include 'com._1c.g5.v8.dt.debug.*.jar' }

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
testCompile 'org.xmlunit:xmlunit-core:2.6.4'
testCompile 'org.xmlunit:xmlunit-matchers:2.6.4'
testCompile 'com.fasterxml.jackson.core:jackson-core:2.11.0'
testCompile 'com.fasterxml.jackson.core:jackson-databind:2.11.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testCompile 'org.xmlunit:xmlunit-core:2.9.0'
testCompile 'org.xmlunit:xmlunit-matchers:2.9.0'
testCompile 'com.fasterxml.jackson.core:jackson-core:2.13.1'
testCompile 'com.fasterxml.jackson.core:jackson-databind:2.13.1'
}

tasks.withType(JavaCompile) {
sourceSets.main.compileClasspath += configurations.providedCompile
sourceSets.main.compileClasspath += configurations.providedRuntime
options.compilerArgs += ["-Aproject=${project.group}/${project.name}"]
options.encoding = 'UTF-8'
}

run {
classpath += configurations.providedCompile
classpath += configurations.providedRuntime
}

test {
finalizedBy jacocoTestReport
classpath += configurations.providedCompile
classpath += configurations.providedRuntime
useJUnitPlatform()
testLogging.showStandardStreams = true
}
Expand Down
32 changes: 24 additions & 8 deletions src/main/java/com/clouds42/AbstractDebugClient.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of Coverage41C.
*
* Copyright (c) 2020-2021
* Copyright (c) 2020-2022
* Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down Expand Up @@ -29,9 +29,15 @@
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.dynamic.HttpClientTransportDynamic;
import org.eclipse.jetty.client.util.FutureResponseListener;
import org.eclipse.jetty.client.util.StringContentProvider;
import org.eclipse.jetty.http.*;
import org.eclipse.jetty.client.util.StringRequestContent;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpFields;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -66,16 +72,26 @@ protected HttpClient createHttpClient() {
protected HttpClient createHttpClient(long idleTimeout) {
SslContextFactory.Client sslContextFactory = new SslContextFactory.Client();
sslContextFactory.setTrustAll(true);
HttpClient httpClient = new HttpClient(sslContextFactory);
HttpField agent = new HttpField("User-Agent", "1CV8");

ClientConnector clientConnector = new ClientConnector();
clientConnector.setSslContextFactory(sslContextFactory);

HttpClient httpClient = new HttpClient(new HttpClientTransportDynamic(clientConnector));
httpClient.setFollowRedirects(true);
httpClient.setUserAgentField(agent);
httpClient.setUserAgentField(new HttpField("User-Agent", "1CV8"));
httpClient.setIdleTimeout(idleTimeout);
return httpClient;
}

protected Request buildRequest(HttpClient httpClient, HttpMethod method, String componentUrl) {
return httpClient.newRequest(this.toUri(componentUrl)).method(method).header(HttpHeader.ACCEPT, "application/xml").header(HttpHeader.CONNECTION, HttpHeader.KEEP_ALIVE.asString()).header(HttpHeader.CONTENT_TYPE, "application/xml").header("1C-ApplicationName", "1C:Enterprise DT");
return httpClient.newRequest(this.toUri(componentUrl))
.method(method)
.headers(httpFields -> httpFields
.add(HttpHeader.ACCEPT, "application/xml")
.add(HttpHeader.CONNECTION, HttpHeader.KEEP_ALIVE.asString())
.add(HttpHeader.CONTENT_TYPE, "application/xml")
.add("1C-ApplicationName", "1C:Enterprise DT")
);
}

protected String getComponentUrl(String debugServerUrl, String suffix) {
Expand All @@ -101,7 +117,7 @@ protected static <T extends EObject> T performRuntimeHttpRequest(AbstractDebugCl
if (requestContent != null) {
try {
String serializedRequest = abstractDebugClient.serializer.serialize(requestContent);
request.content(new StringContentProvider(serializedRequest));
request.body(new StringRequestContent(serializedRequest));
} catch (IOException e) {
throw new RuntimeDebugClientException("Error occurred while processing request", e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of Coverage41C.
*
* Copyright (c) 2020-2021
* Copyright (c) 2020-2022
* Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of Coverage41C.
*
* Copyright (c) 2020-2021
* Copyright (c) 2020-2022
* Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of Coverage41C.
*
* Copyright (c) 2020-2021
* Copyright (c) 2020-2022
* Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand All @@ -21,7 +21,8 @@
*/
package com.clouds42.CommandLineOptions;

import com._1c.g5.v8.dt.debug.model.base.data.DebugTargetType;

import com.clouds42.DebugTargetType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import picocli.CommandLine.Option;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of Coverage41C.
*
* Copyright (c) 2020-2021
* Copyright (c) 2020-2022
* Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of Coverage41C.
*
* Copyright (c) 2020-2021
* Copyright (c) 2020-2022
* Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of Coverage41C.
*
* Copyright (c) 2020-2021
* Copyright (c) 2020-2022
* Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of Coverage41C.
*
* Copyright (c) 2020-2021
* Copyright (c) 2020-2022
* Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/clouds42/Commands/ConvertCommand.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of Coverage41C.
*
* Copyright (c) 2020-2021
* Copyright (c) 2020-2022
* Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/clouds42/Commands/CoverServer.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of Coverage41C.
*
* Copyright (c) 2020-2021
* Copyright (c) 2020-2022
* Kosolapov Stanislav aka proDOOMman <prodoomman@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Loading