Skip to content

Commit a0a954f

Browse files
committed
Finish v0.18.0
2 parents 743c440 + bfe0a70 commit a0a954f

22 files changed

Lines changed: 297 additions & 55 deletions

File tree

.github/copilot-instructions.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# MDClasses Repository Instructions
2+
3+
## Overview
4+
5+
MDClasses is a Java library for reading and analyzing metadata from 1C:Enterprise 8 platform. The library works with configurations exported in XML format (via configurator or merge/comparison tools) or in EDT format.
6+
7+
**Project Type**: Java library
8+
**Build Tool**: Gradle with Kotlin DSL
9+
**Primary Language**: Java 21+
10+
**Target Runtime**: JVM (Java 21, 25 tested)
11+
**Repository Size**: Medium-sized Java project with extensive test coverage
12+
13+
## Build and Test Instructions
14+
15+
### Prerequisites
16+
- Java 21 or higher (tested on Java 21, and 25)
17+
- Git with LFS support for test data
18+
- No additional environment setup required
19+
20+
### Bootstrap and Build Commands
21+
22+
**Always initialize Git submodules and LFS when cloning:**
23+
```bash
24+
git submodule update --init --recursive
25+
git lfs pull
26+
```
27+
28+
**Build the project:**
29+
```bash
30+
./gradlew build
31+
```
32+
33+
**Run tests only:**
34+
```bash
35+
./gradlew test
36+
```
37+
38+
**Run quality checks (includes tests and code quality):**
39+
```bash
40+
./gradlew check
41+
```
42+
43+
**Generate Javadoc:**
44+
```bash
45+
./gradlew javadoc
46+
```
47+
48+
**Run all precommit checks:**
49+
```bash
50+
./gradlew precommit
51+
```
52+
This runs tests and updates license headers.
53+
54+
**Update license headers:**
55+
```bash
56+
./gradlew updateLicenses
57+
```
58+
59+
**Clean build artifacts:**
60+
```bash
61+
./gradlew clean
62+
```
63+
64+
### Build Notes
65+
- The build uses Gradle wrapper (`./gradlew` on Unix, `gradlew.bat` on Windows)
66+
- Always use the wrapper to ensure consistent Gradle version
67+
- Test results are located in `build/reports/tests/test/`
68+
- JaCoCo coverage reports are in `build/reports/jacoco/test/`
69+
- Build time: typically 1-2 minutes for full build with tests
70+
71+
### Common Build Issues
72+
- If tests fail due to missing test data, ensure Git LFS is properly initialized
73+
- Lombok annotations are used extensively - IDE should have Lombok plugin installed
74+
- If seeing "out of memory" errors, set `org.gradle.jvmargs=-Xmx2048m` in `gradle.properties`
75+
76+
## Project Structure
77+
78+
### Key Directories
79+
- `src/main/java/` - Main source code
80+
- `com/github/_1c_syntax/bsl/reader/` - Core readers for different formats
81+
- `com/github/_1c_syntax/bsl/mdo/` - Metadata object model classes
82+
- `com/github/_1c_syntax/bsl/mdclasses/` - Main library API
83+
- `src/test/java/` - Test code
84+
- `src/test/resources/` - Test fixtures and sample configurations
85+
- `src/main/resources/` - XSD schemas and converters
86+
- `docs/` - Documentation (MkDocs format, Russian and English)
87+
- `.github/workflows/` - CI/CD pipelines
88+
89+
### Key Configuration Files
90+
- `build.gradle.kts` - Main build configuration (Gradle Kotlin DSL)
91+
- `settings.gradle.kts` - Gradle settings
92+
- `gradle.properties` - Build properties
93+
- `lombok.config` - Lombok configuration
94+
- `mkdocs.yml` / `mkdocs.en.yml` - Documentation configuration
95+
- `.github/workflows/java-ci.yml` - Main CI pipeline
96+
- `.github/workflows/gh-pages.yml` - Documentation deployment
97+
- `license/HEADER.txt` - License header template
98+
99+
### Main Entry Points
100+
- `com.github._1c_syntax.bsl.mdclasses.MDClasses` - Main API class for loading configurations
101+
- `com.github._1c_syntax.bsl.mdo.Configuration` - Root configuration object
102+
- `com.github._1c_syntax.bsl.reader.designer.DesignerReader` - XML format reader
103+
- `com.github._1c_syntax.bsl.reader.edt.EDTReader` - EDT format reader
104+
105+
## CI/CD Validation
106+
107+
### GitHub Actions Workflows
108+
1. **Java CI** (`.github/workflows/java-ci.yml`)
109+
- Runs on: push and pull request
110+
- Tests matrix: Java 21, 25 on Ubuntu, Windows, macOS
111+
- Command: `./gradlew check --stacktrace`
112+
- Duration: ~5-10 minutes
113+
- Artifacts: Test results uploaded for all matrix combinations
114+
115+
2. **GitHub Pages** (`.github/workflows/gh-pages.yml`)
116+
- Runs on: push to master/develop when docs change
117+
- Builds Javadoc and MkDocs documentation
118+
- Requires Python 3.10+ and Java 21
119+
120+
### Pre-commit Validation Steps
121+
Before submitting a PR, ensure:
122+
1. All tests pass: `./gradlew test`
123+
2. Code quality checks pass: `./gradlew check`
124+
3. License headers are up to date: `./gradlew updateLicenses`
125+
4. If touching docs, verify locally: `pip install mkdocs mkdocs-material pygments-bsl && mkdocs serve`
126+
127+
## Code Conventions
128+
129+
### Java Code Style
130+
- Target Java 21, use modern Java features where appropriate
131+
- Use Lombok annotations for reducing boilerplate (`@Getter`, `@Setter`, `@Builder`, etc.)
132+
- Package naming: `com.github._1c_syntax.bsl.*`
133+
- Follow standard Java naming conventions
134+
- UTF-8 encoding for all files
135+
- License headers required on all Java files (automatically updated via Gradle task)
136+
137+
### Project-Specific Patterns
138+
- This is a **read-only** library - it does not modify configurations
139+
- Metadata objects follow 1C:Enterprise naming and structure
140+
- XStream is used for XML serialization/deserialization
141+
- Use `@Nullable` and `@NonNull` annotations from `org.jspecify`
142+
- Converters pattern used for transforming between different representations
143+
- Extensive use of ClassGraph for runtime class discovery
144+
145+
### Testing Guidelines
146+
- JUnit 5 is used for testing
147+
- AssertJ for fluent assertions
148+
- Test resources include real 1C configuration samples
149+
- Tests are organized by functionality/reader type
150+
- Mock objects avoided in favor of integration tests with real data
151+
152+
## Dependencies
153+
154+
### Key Runtime Dependencies
155+
- `bsl-common-library` - Common 1C:Enterprise language utilities
156+
- `utils` - General utilities
157+
- `supportconf` - Support configuration handling
158+
- XStream - XML processing
159+
- Apache Commons Collections 4 - Collection utilities
160+
- Commons IO - File operations
161+
- ClassGraph - Runtime class discovery
162+
- SLF4J - Logging facade
163+
164+
### Test Dependencies
165+
- JUnit 5 - Testing framework
166+
- AssertJ - Fluent assertions
167+
- JSONAssert - JSON comparison in tests
168+
- Reload4j - Logging implementation for tests
169+
170+
## Additional Notes
171+
172+
### Working with 1C:Enterprise
173+
- The library handles two main formats:
174+
1. **Designer (XML)** format - exported via 1C:Enterprise configurator
175+
2. **EDT** format - modern development environment format
176+
- Metadata structure mirrors 1C:Enterprise concepts (Catalogs, Documents, Registers, etc.)
177+
- Russian language is primary for domain concepts (alternate English names often available)
178+
179+
### Documentation
180+
- Dual-language documentation (Russian primary, English available)
181+
- Javadoc is comprehensive and should be maintained
182+
- MkDocs for user-facing documentation
183+
- Update docs when changing public API
184+
185+
### Performance
186+
- Benchmark tools available (`src/jmh/`)
187+
- JMH benchmarks for performance testing
188+
- Results stored in `build/jmh-results.json`
189+
190+
### Integration
191+
- Library is designed to be used by BSL Language Server
192+
- Maven Central releases for public consumption
193+
- Snapshot builds deployed to Sonatype for testing
194+
195+
## Trust These Instructions
196+
197+
These instructions have been validated against the current codebase. Trust them as accurate and only search for additional information if something is incomplete or contradicts observed behavior.

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
java_version: ['17', '21', '25']
11+
java_version: ['21', '25']
1212
os: [ubuntu-latest, windows-latest, macOS-latest]
1313
include:
1414
- os: windows-latest

.github/workflows/gh-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
- name: Setup JDK
2626
uses: actions/setup-java@v5
2727
with:
28-
java-version: 17
28+
java-version: 21
2929
distribution: 'liberica'
3030
- name: Build javadoc
3131
run: ./gradlew --no-daemon javadoc
3232

3333
- name: Set up Python
34-
uses: actions/setup-python@v6.1.0
34+
uses: actions/setup-python@v6.2.0
3535
with:
3636
python-version: '3.10'
3737
architecture: 'x64'

.github/workflows/publish-to-maven-central.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up JDK
1919
uses: actions/setup-java@v5
2020
with:
21-
java-version: 17
21+
java-version: 21
2222
distribution: 'temurin'
2323
cache: gradle
2424
- name: Deploy to Central Portal

.github/workflows/qa-sq.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
lfs: true
2020
- run: |
2121
git fetch --prune --unshallow
22-
- name: Set up JDK 17
22+
- name: Set up JDK
2323
uses: actions/setup-java@v5
2424
with:
25-
java-version: 17
25+
java-version: 21
2626
distribution: 'liberica'
2727
- name: SonarCloud Scan
2828
run: ./gradlew check sonar

.github/workflows/update-gradle.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
fetch-depth: 0
1616
fetch-tags: true
1717

18-
- name: Set up JDK 17
18+
- name: Set up JDK
1919
uses: actions/setup-java@v5
2020
with:
21-
java-version: 17
21+
java-version: 21
2222
distribution: 'temurin'
2323
cache: gradle
2424

build.gradle.kts

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,60 +50,52 @@ repositories {
5050

5151
dependencies {
5252

53-
implementation("org.apache.commons", "commons-collections4", "4.4")
53+
implementation("org.apache.commons:commons-collections4:4.5.0")
5454

55-
implementation("com.thoughtworks.xstream", "xstream", "1.4.21")
55+
implementation("com.thoughtworks.xstream:xstream:1.4.21")
5656

5757
// логирование
58-
implementation("org.slf4j", "slf4j-api", "2.1.0-alpha1")
58+
implementation("org.slf4j:slf4j-api:2.0.16")
5959

6060
// прочее
61-
implementation("commons-io", "commons-io", "2.18.0")
61+
implementation("commons-io:commons-io:2.21.0")
6262

63-
implementation("io.github.1c-syntax", "bsl-common-library", "0.9.2")
64-
implementation("io.github.1c-syntax", "utils", "0.6.8")
65-
implementation("io.github.1c-syntax", "supportconf", "0.15.0") {
66-
exclude("io.github.1c-syntax", "bsl-common-library")
67-
}
63+
implementation("io.github.1c-syntax:bsl-common-library:0.10.0")
64+
implementation("io.github.1c-syntax:utils:0.7.0")
65+
implementation("io.github.1c-syntax:supportconf:0.16.0")
6866

6967
// быстрый поиск классов
70-
implementation("io.github.classgraph", "classgraph", "4.8.179")
68+
implementation("io.github.classgraph:classgraph:4.8.184")
7169

72-
implementation("org.jspecify", "jspecify", "1.0.0")
70+
implementation("org.jspecify:jspecify:1.0.0")
7371

7472
// тестирование
75-
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.11.4")
76-
testImplementation("org.junit.jupiter", "junit-jupiter-engine", "5.11.4")
77-
testImplementation("org.junit.jupiter", "junit-jupiter-params", "5.11.4")
78-
testImplementation("org.assertj", "assertj-core", "3.27.0")
79-
testImplementation("com.ginsberg", "junit5-system-exit", "2.0.2")
80-
testImplementation("org.skyscreamer", "jsonassert", "1.5.3")
81-
testImplementation("org.objenesis", "objenesis", "3.4")
73+
testImplementation(platform("org.junit:junit-bom:6.0.3"))
74+
testImplementation("org.junit.jupiter:junit-jupiter-api")
75+
testImplementation("org.junit.jupiter:junit-jupiter-params")
76+
testImplementation("org.assertj:assertj-core:3.27.7")
77+
testImplementation("com.ginsberg:junit5-system-exit:2.0.2")
78+
testImplementation("org.skyscreamer:jsonassert:1.5.3")
79+
testImplementation("org.objenesis:objenesis:3.5")
80+
81+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
82+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
8283

8384
// логирование
84-
testImplementation("org.slf4j", "slf4j-reload4j", "2.1.0-alpha1")
85-
testRuntimeOnly("org.junit.platform", "junit-platform-launcher", "6.1.0-M1")
85+
testImplementation("org.slf4j:slf4j-reload4j:2.0.16")
8686

8787
// бенчмарк
8888
jmh("org.openjdk.jmh:jmh-core:1.37")
8989
jmhAnnotationProcessor("org.openjdk.jmh:jmh-generator-annprocess:1.37")
9090
}
9191

9292
java {
93-
sourceCompatibility = JavaVersion.VERSION_17
94-
targetCompatibility = JavaVersion.VERSION_17
93+
sourceCompatibility = JavaVersion.VERSION_21
94+
targetCompatibility = JavaVersion.VERSION_21
9595
withSourcesJar()
9696
withJavadocJar()
9797
}
9898

99-
sourceSets {
100-
main {
101-
resources {
102-
exclude("**/*.xsd")
103-
}
104-
}
105-
}
106-
10799
jmh {
108100
warmupIterations = 3
109101
iterations = 5

docs/ru/systemRequirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
MDClasses представляет собой Java библиотеку, соответственно ее использование возможно в приложения, использующих JVM.
88

9-
На данный момент библиотека разрабатывается с использованием Java 17, но в рамках сборочных конвейеров происходит проверка работоспособности при использовании более свежих версий, в частности версии Java 20.
9+
На данный момент библиотека разрабатывается с использованием Java 21, но в рамках сборочных конвейеров происходит проверка работоспособности при использовании более свежих версий, в частности версии Java 25.
1010

1111
## Поддерживаемые операционные системы
1212

gradle/wrapper/gradle-wrapper.jar

718 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)