Skip to content

Commit

Permalink
Finish 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
theshadowco committed Jun 4, 2024
2 parents 62afe74 + cefc693 commit 07d009d
Show file tree
Hide file tree
Showing 599 changed files with 25,821 additions and 40,342 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
groups:
freefair:
patterns:
- "io.freefair.*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: ./gradlew --no-daemon javadoc

- name: Set up Python
uses: actions/setup-python@v5.0.0
uses: actions/setup-python@v5.1.0
with:
python-version: '3.10'
architecture: 'x64'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ build/
/.idea/sonar*

/.idea/misc.xml
Gradle_*.xml
/.idea/material_theme_project_new.xml
*.hprof
*.hprof.idom
1 change: 1 addition & 0 deletions .idea/gradle.xml

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

1 change: 0 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=1c-syntax_mdclasses&metric=coverage)](https://sonarcloud.io/dashboard?id=1c-syntax_mdclasses)

[![Download](https://img.shields.io/github/release/1c-syntax/mdclasses.svg?label=download&style=flat)](https://github.com/1c-syntax/mdclasses/releases/latest)
[![JitPack](https://jitpack.io/v/1c-syntax/mdclasses.svg)](https://jitpack.io/#1c-syntax/mdclasses)
[![GitHub Releases](https://img.shields.io/github/downloads/1c-syntax/mdclasses/latest/total?style=flat-square)](https://github.com/1c-syntax/mdclasses/releases)

## Сайт проекта (документация)
Expand Down
24 changes: 12 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ plugins {
signing
id("org.cadixdev.licenser") version "0.6.1"
id("me.qoomon.git-versioning") version "6.4.3"
id("com.gorylenko.gradle-git-properties") version "2.4.1"
id("io.freefair.lombok") version "8.4"
id("io.freefair.javadoc-links") version "8.4"
id("io.freefair.javadoc-utf-8") version "8.4"
id("io.freefair.maven-central.validate-poms") version "8.4"
id("ru.vyarus.pom") version "2.2.2"
id("org.sonarqube") version "4.4.1.3373"
id("com.gorylenko.gradle-git-properties") version "2.4.2"
id("io.freefair.lombok") version "8.6"
id("io.freefair.javadoc-links") version "8.6"
id("io.freefair.javadoc-utf-8") version "8.6"
id("io.freefair.maven-central.validate-poms") version "8.6"
id("ru.vyarus.pom") version "3.0.0"
id("org.sonarqube") version "5.0.0.4638"
id("io.codearte.nexus-staging") version "0.30.0"
}

Expand Down Expand Up @@ -51,13 +51,13 @@ dependencies {
implementation("com.thoughtworks.xstream", "xstream", "1.4.20")

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

// прочее
implementation("commons-io", "commons-io", "2.8.0")
implementation("com.github.1c-syntax", "utils", "0.5.1")
implementation("io.github.1c-syntax", "bsl-common-library", "0.5.0")
implementation("io.github.1c-syntax", "supportconf", "0.12.1") {
implementation("io.github.1c-syntax", "utils", "0.6.1")
implementation("io.github.1c-syntax", "bsl-common-library", "0.6.0")
implementation("io.github.1c-syntax", "supportconf", "0.14.0") {
exclude("io.github.1c-syntax", "bsl-common-library")
}

Expand All @@ -75,7 +75,7 @@ dependencies {

// логирование
// https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12
testImplementation("org.slf4j", "slf4j-log4j12", "1.7.30")
testImplementation("org.slf4j", "slf4j-log4j12", "2.1.0-alpha1")
}

java {
Expand Down
2 changes: 0 additions & 2 deletions jitpack.yml

This file was deleted.

49 changes: 21 additions & 28 deletions src/main/java/com/github/_1c_syntax/bsl/mdclasses/CF.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2023
* Copyright (c) 2019 - 2024
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand All @@ -21,12 +21,10 @@
*/
package com.github._1c_syntax.bsl.mdclasses;

import com.github._1c_syntax.bsl.mdo.CommonModule;
import com.github._1c_syntax.bsl.mdo.MD;
import com.github._1c_syntax.bsl.mdo.Module;
import com.github._1c_syntax.bsl.mdo.ModuleOwner;
import com.github._1c_syntax.bsl.mdo.Subsystem;
import com.github._1c_syntax.bsl.mdo.children.ObjectModule;
import com.github._1c_syntax.bsl.mdo.support.ApplicationRunMode;
import com.github._1c_syntax.bsl.mdo.support.ScriptVariant;
import com.github._1c_syntax.bsl.mdo.support.UsePurposes;
Expand All @@ -38,7 +36,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.Optional;

public interface CF extends MDClass, ConfigurationTree {

Expand Down Expand Up @@ -85,24 +83,12 @@ public interface CF extends MDClass, ConfigurationTree {
/**
* Возвращает соответствие пути к модулю его типу
*/
default Map<URI, ModuleType> getModulesByType() {
return getAllModules().stream().collect(Collectors.toMap(Module::getUri, Module::getModuleType));
}
Map<URI, ModuleType> getModulesByType();

/**
* Возвращает соответствие типов модулей их путям к файлам сгруппированные по представлению ссылки объекта-владельца
* Возвращает соответствие пути к модулю к нему самому
*/
default Map<String, Map<ModuleType, URI>> modulesByMDORef() {
return getPlainChildren().stream()
.filter(ModuleOwner.class::isInstance)
.map(ModuleOwner.class::cast)
.collect(Collectors.toMap(
(MD md) -> md.getMdoReference().getMdoRef(),
md -> md.getModules().stream()
.collect(Collectors.toMap(Module::getModuleType, Module::getUri))
)
);
}
Map<URI, Module> getModulesByURI();

/**
* Возвращает соответствие типов модулей их путям к файлам для дочернего объекта
Expand All @@ -126,15 +112,7 @@ default Map<ModuleType, URI> mdoModuleTypes(String mdoRef) {
/**
* Возвращает соответствие пути файла модуля ссылке его владельца
*/
default Map<URI, MdoReference> modulesByObject() {
return getAllModules().stream().collect(Collectors.toMap(Module::getUri, (Module module) -> {
if (module instanceof ObjectModule objectModule) {
return objectModule.getOwner();
} else {
return ((CommonModule) module).getMdoReference();
}
}));
}
Map<URI, MD> getModulesByObject();

/**
* Возвращает список подсистем, в состав которых входит объект метаданных
Expand Down Expand Up @@ -165,4 +143,19 @@ default List<Subsystem> includedSubsystems(MdoReference mdoReference, boolean ad
.flatMap(subsystem -> subsystem.included(mdoReference, addParentSubsystem).stream())
.toList();
}

@Override
default ModuleType getModuleTypeByURI(URI uri) {
return getModulesByType().getOrDefault(uri, ModuleType.UNKNOWN);
}

@Override
default Optional<Module> getModuleByUri(URI uri) {
return Optional.ofNullable(getModulesByURI().get(uri));
}

@Override
default Optional<MD> findChild(URI uri) {
return Optional.ofNullable(getModulesByObject().get(uri));
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2023
* Copyright (c) 2019 - 2024
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down Expand Up @@ -77,10 +77,13 @@
import com.github._1c_syntax.bsl.mdo.support.ScriptVariant;
import com.github._1c_syntax.bsl.mdo.support.UseMode;
import com.github._1c_syntax.bsl.mdo.support.UsePurposes;
import com.github._1c_syntax.bsl.mdo.utils.LazyLoader;
import com.github._1c_syntax.bsl.support.CompatibilityMode;
import com.github._1c_syntax.bsl.support.SupportVariant;
import com.github._1c_syntax.bsl.types.ConfigurationSource;
import com.github._1c_syntax.bsl.types.MdoReference;
import com.github._1c_syntax.bsl.types.ModuleType;
import com.github._1c_syntax.utils.Lazy;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
Expand All @@ -89,8 +92,10 @@
import lombok.ToString;
import lombok.Value;

import java.net.URI;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
* Корневой класс конфигурации 1с
Expand Down Expand Up @@ -139,6 +144,7 @@ public class Configuration implements CF {
ApplicationRunMode defaultRunMode = ApplicationRunMode.AUTO;
@Default
List<Module> modules = Collections.emptyList();
Lazy<List<Module>> allModules = new Lazy<>(this::computeAllModules);
@Default
String vendor = "";
@Default
Expand Down Expand Up @@ -243,6 +249,11 @@ public class Configuration implements CF {

@Singular
List<MD> children;
Lazy<List<MD>> plainChildren = new Lazy<>(this::computePlainChildren);

Lazy<Map<URI, ModuleType>> modulesByType = new Lazy<>(this::computeModulesByType);
Lazy<Map<URI, Module>> modulesByURI = new Lazy<>(this::computeModulesByURI);
Lazy<Map<URI, MD>> modulesByObject = new Lazy<>(this::computeModulesByObject);

/*
* Свое
Expand Down Expand Up @@ -306,6 +317,51 @@ public class Configuration implements CF {
@Default
MultiLanguageString briefInformation = MultiLanguageString.EMPTY;

@Override
public List<Module> getAllModules() {
return allModules.getOrCompute();
}

@Override
public List<MD> getPlainChildren() {
return plainChildren.getOrCompute();
}

@Override
public Map<URI, ModuleType> getModulesByType() {
return modulesByType.getOrCompute();
}

@Override
public Map<URI, MD> getModulesByObject() {
return modulesByObject.getOrCompute();
}

@Override
public Map<URI, Module> getModulesByURI() {
return modulesByURI.getOrCompute();
}

private List<MD> computePlainChildren() {
return LazyLoader.computePlainChildren(this);
}

private Map<URI, ModuleType> computeModulesByType() {
return LazyLoader.computeModulesByType(this);
}

private Map<URI, MD> computeModulesByObject() {
return LazyLoader.computeModulesByObject(this);
}

private List<Module> computeAllModules() {
return LazyLoader.computeAllModules(this);
}

private Map<URI, Module> computeModulesByURI() {
return LazyLoader.computeModulesByURI(this);
}

private static Configuration createEmptyConfiguration() {
var emptyString = "empty";

Expand Down
Loading

0 comments on commit 07d009d

Please sign in to comment.