Skip to content

Commit

Permalink
# Релиз 0.2
Browse files Browse the repository at this point in the history
## Новое в релизе

+ Добавлены новые значения в перечисление MDOType
+ Добавлено перечисление типов модуле ModuleType
+ Добавлено перечисление с вариантами поддержки поставщика SupportVariant

# Прочие изменения

+ Обновлен Gradle до версии 7.4
+ Обновлены зависимости
+ Изменено имя группы библиотеки на "io.github.1c-syntax"
  • Loading branch information
theshadowco committed Feb 20, 2022
2 parents 03dc030 + 5fba4a8 commit 79d3b62
Show file tree
Hide file tree
Showing 15 changed files with 426 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: ['11', '16']
java_version: ['11', '17']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/[email protected]
Expand Down
54 changes: 28 additions & 26 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
import java.net.URI
import java.util.*

plugins {
`java-library`
`maven-publish`
jacoco
id("net.kyori.indra.license-header") version "1.3.1"
id("com.github.gradle-git-version-calculator") version "1.1.0"
id("io.freefair.lombok") version "6.0.0-m2"
id("io.freefair.javadoc-links") version "6.0.0-m2"
id("io.freefair.javadoc-utf-8") version "6.0.0-m2"
id("org.sonarqube") version "3.3"
id("org.cadixdev.licenser") version "0.6.1"
id("com.github.gradle-git-version-calculator") version "1.1.0"
id("io.freefair.lombok") version "6.4.1"
id("io.freefair.javadoc-links") version "6.4.1"
id("io.freefair.javadoc-utf-8") version "6.4.1"
}

group = "com.github.1c-syntax"
version = gitVersionCalculator.calculateVersion("v")

repositories {
mavenLocal()
mavenCentral()
maven { url = URI("https://jitpack.io") }
maven(url = "https://jitpack.io")
}

repositories {
mavenCentral()
}
group = "io.github.1c-syntax"
version = gitVersionCalculator.calculateVersion("v")

val junitVersion = "5.6.1"
dependencies {

implementation("org.apache.commons", "commons-collections4", "4.4")

// логирование
implementation("org.slf4j", "slf4j-api", "1.7.30")

// stat analysis
compileOnly("com.google.code.findbugs", "jsr305", "3.0.2")

// тестирование
testImplementation("org.junit.jupiter", "junit-jupiter-api", junitVersion)
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", junitVersion)
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.6.1")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "5.6.1")
testImplementation("org.assertj", "assertj-core", "3.18.1")
testImplementation("com.ginsberg", "junit5-system-exit", "1.0.0")

Expand All @@ -44,10 +42,6 @@ dependencies {
testImplementation("org.slf4j", "slf4j-log4j12", "1.7.30")
}

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_11
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand All @@ -57,11 +51,13 @@ java {

tasks.test {
useJUnitPlatform()

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

reports {
html.isEnabled = true
html.required.set(true)
}
}

Expand All @@ -71,8 +67,8 @@ tasks.check {

tasks.jacocoTestReport {
reports {
xml.isEnabled = true
xml.destination = File("$buildDir/reports/jacoco/test/jacoco.xml")
xml.required.set(true)
xml.outputLocation.set(File("$buildDir/reports/jacoco/test/jacoco.xml"))
}
}

Expand Down Expand Up @@ -100,7 +96,8 @@ artifacts {
}

license {
header = rootProject.file("license/HEADER.txt")
header(rootProject.file("license/HEADER.txt"))
newLine(false)
ext["year"] = "2021 - " + Calendar.getInstance().get(Calendar.YEAR)
ext["name"] = "Tymko Oleg <[email protected]>, Maximov Valery <[email protected]>"
ext["project"] = "BSL Common library"
Expand Down Expand Up @@ -154,5 +151,10 @@ tasks.register("precommit") {
description = "Run all precommit tasks"
group = "Developer tools"
dependsOn(":test")
dependsOn(":licenseFormat")
dependsOn(":updateLicenses")
}

tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions)
.addStringOption("Xdoclint:none", "-quiet")
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion license/HEADER.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This file is a part of ${project}.

Copyright © ${year}
Copyright (c) ${year}
${name} 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 BSL Common library.
*
* Copyright © 2021 - 2021
* Copyright (c) 2021 - 2022
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand All @@ -19,7 +19,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with BSL Common library.
*/
package com.github._1c_syntax.bsl_common_library;
package com.github._1c_syntax.bsl.support;

import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand Down Expand Up @@ -89,10 +89,10 @@ public static int compareTo(CompatibilityMode versionA, CompatibilityMode versio
if (versionA.minor == versionB.minor) {
if (versionA.version == versionB.version) {
result = 0;
} else if (versionA.version >= versionB.version) {
} else if (versionA.version > versionB.version) {
result = -1;
}
} else if (versionA.minor >= versionB.minor) {
} else if (versionA.minor > versionB.minor) {
result = -1;
}
return result;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* This file is a part of BSL Common library.
*
* Copyright (c) 2021 - 2022
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*
* BSL Common library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* BSL Common library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with BSL Common library.
*/
package com.github._1c_syntax.bsl.support;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;

/**
* Варианты поддержки конфигурации поставщика
*/
@AllArgsConstructor
public enum SupportVariant {
NOT_EDITABLE(0), EDITABLE_SUPPORT_ENABLED(1), NOT_SUPPORTED(2), NONE(99);

@Getter
private final int priority;

/**
* Возвращает вариант поддержки с максимальным уровнем
*
* @param variants Список вариантов поддержки
* @return Максимальный вариант поддержки
*/
public static SupportVariant max(Collection<SupportVariant> variants) {
return variants.stream().min(Comparator.comparing(SupportVariant::getPriority))
.orElse(SupportVariant.NONE);
}

/**
* Находит элемент по приоритету
*
* @param priority номер приоритета
* @return Найденное значение
*/
public static SupportVariant valueOf(int priority) {
var result = Arrays.stream(values())
.filter(supportVariant -> supportVariant.priority == priority).findFirst();
if (result.isEmpty()) {
return NONE;
}
return result.get();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Common library.
*
* Copyright © 2021 - 2021
* Copyright (c) 2021 - 2022
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand All @@ -19,7 +19,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with BSL Common library.
*/
package com.github._1c_syntax.bsl_common_library.types;
package com.github._1c_syntax.bsl.types;

/**
* Возможные виды конфигураций по формату данных
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Common library.
*
* Copyright © 2021 - 2021
* Copyright (c) 2021 - 2022
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand All @@ -19,7 +19,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with BSL Common library.
*/
package com.github._1c_syntax.bsl_common_library.types;
package com.github._1c_syntax.bsl.types;

import lombok.Getter;
import org.apache.commons.collections4.map.CaseInsensitiveMap;
Expand Down Expand Up @@ -63,6 +63,7 @@ public enum MDOType {
ENUM("Enum", "Enums", "Перечисление", "Перечисления"),
EVENT_SUBSCRIPTION("EventSubscription", "EventSubscriptions", "ПодпискаНаСобытие", "ПодпискиНаСобытия"),
EXCHANGE_PLAN("ExchangePlan", "ExchangePlans", "ПланОбмена", "ПланыОбмена"),
EXTERNAL_DATA_SOURCE("ExternalDataSource", "ExternalDataSources", "ВнешнийИсточникДанных", "ВнешниеИсточникиДанных"),
FILTER_CRITERION("FilterCriterion", "FilterCriteria", "КритерийОтбора", "КритерииОтбора"),
FUNCTIONAL_OPTION("FunctionalOption", "FunctionalOptions", "ФункциональнаяОпция", "ФункциональныеОпции"),
FUNCTIONAL_OPTIONS_PARAMETER("FunctionalOptionsParameter", "FunctionalOptionsParameters",
Expand Down Expand Up @@ -90,11 +91,21 @@ public enum MDOType {
COMMAND("Command", "Commands", "Команда", "Команды"),
TEMPLATE("Template", "Templates", "Макет", "Макеты"),
ATTRIBUTE("Attribute", "Attributes", "Реквизит", "Реквизиты"),
TABULAR_SECTION("TabularSection", "TabularSections", "ТабличнаяЧасть", "ТабличныеЧасти"),
RECALCULATION("Recalculation", "Recalculations", "Перерасчет", "Перерасчеты"),
WS_OPERATION("Operation", "Operations", "Операция", "Операции"),
WS_OPERATION_PARAMETER("Parameter", "Parameters", "Параметр", "Параметры"),
HTTP_SERVICE_URL_TEMPLATE("URLTemplate", "URLTemplates", "ШаблонURL", "ШаблоныURL"),
HTTP_SERVICE_METHOD("Method", "Methods", "Метод", "Методы"),
INTEGRATION_SERVICE_CHANNEL("IntegrationServiceChannel", "IntegrationServiceChannels", "КаналСервисаИнтеграции", "Каналы"),
TASK_ADDRESSING_ATTRIBUTE("AddressingAttribute", "AddressingAttributes", "РеквизитАдресации", "Реквизиты адресации"),
REGISTER_DIMENSION("Dimension", "Dimensions", "Измерение", "Измерения"),
SEQUENCE_DIMENSION("Dimension", "Dimensions", "ИзмерениеПоследовательности", "ИзмеренияПоследовательности"),
RESOURCE("Resource", "Resources", "Ресурс", "Ресурсы"),
ENUM_VALUE("EnumValue", "EnumValues", "ЗначениеПеречисления", "ЗначенияПеречисления"),
COLUMN("Column", "Columns", "Колонка", "Колонки"),
ACCOUNTING_FLAG("AccountingFlag", "AccountingFlags", "ПризнакУчета", "ПризнакиУчета"),
EXT_DIMENSION_ACCOUNTING_FLAG("ExtDimensionAccountingFlag", "ExtDimensionAccountingFlags", "ПризнакУчетаСубконто", "ПризнакиУчетаСубконто"),
UNKNOWN("", "", "", "");

private static final Map<String, MDOType> MAP_TYPES = computeMapTypes();
Expand Down Expand Up @@ -165,8 +176,9 @@ private static Map<String, MDOType> computeMapTypes() {
}

private static Set<MDOType> computeChildTypes() {
return Set.of(FORM, COMMAND, TEMPLATE, ATTRIBUTE, RECALCULATION, WS_OPERATION, HTTP_SERVICE_URL_TEMPLATE,
HTTP_SERVICE_METHOD, INTEGRATION_SERVICE_CHANNEL);
return Set.of(FORM, COMMAND, TEMPLATE, ATTRIBUTE, TABULAR_SECTION, RECALCULATION, WS_OPERATION,
WS_OPERATION_PARAMETER, HTTP_SERVICE_URL_TEMPLATE, HTTP_SERVICE_METHOD, INTEGRATION_SERVICE_CHANNEL,
TASK_ADDRESSING_ATTRIBUTE, SEQUENCE_DIMENSION, REGISTER_DIMENSION, RESOURCE, ENUM_VALUE, COLUMN,
ACCOUNTING_FLAG, EXT_DIMENSION_ACCOUNTING_FLAG);
}

}
Loading

0 comments on commit 79d3b62

Please sign in to comment.