Skip to content

Commit

Permalink
Finish 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
theshadowco committed May 14, 2024
2 parents 0c1d6e8 + d5c6f68 commit 5782c49
Show file tree
Hide file tree
Showing 19 changed files with 323 additions and 232 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
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: ['11', '17', '20']
java_version: ['17', '20']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Build with Gradle
run: ./gradlew check --stacktrace
- name: Archive test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: junit_report_${{ matrix.os }}_${{ matrix.java_version }}
path: build/reports/tests/test
37 changes: 37 additions & 0 deletions .github/workflows/publish-to-sonatype.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to Sonatype

on:
release:
types: [published]
push:
branches:
- develop
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'liberica'
- name: Publish to Sonatype
run: ./gradlew publishMavenPublicationToSonatypeRepository -PsimplifyVersion
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryPassword: ${{ secrets.GPG_SIGNING_PASSWORD }}
- name: Close repository
if: github.event_name == 'release'
run: ./gradlew closeAndReleaseRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.SONATYPE_PASSWORD }}
4 changes: 2 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: ''
- run: |
git fetch --prune --unshallow
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'adopt'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ build/
/.idea/compiler.xml
/.idea/jarRepositories.xml
*.iml
/.idea/material_theme_project_new.xml
/.idea/inspectionProfiles/Project_Default.xml
/.idea/sonarlint.xml
78 changes: 67 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import me.qoomon.gitversioning.commons.GitRefType
import java.util.*

plugins {
`java-library`
`maven-publish`
jacoco
signing
id("org.cadixdev.licenser") version "0.6.1"
id("com.github.gradle-git-version-calculator") version "1.1.0"
id("io.freefair.lombok") version "8.3"
id("io.freefair.javadoc-links") version "8.3"
id("io.freefair.javadoc-utf-8") version "8.3"
id("org.sonarqube") version "4.4.1.3373"
id("me.qoomon.git-versioning") version "6.4.3"
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("org.sonarqube") version "5.0.0.4638"
id("io.freefair.maven-central.validate-poms") version "8.6"
id("com.github.ben-manes.versions") version "0.51.0"
id("ru.vyarus.pom") version "3.0.0"
id("io.codearte.nexus-staging") version "0.30.0"
}

repositories {
Expand All @@ -19,33 +25,48 @@ repositories {
}

group = "io.github.1c-syntax"
version = gitVersionCalculator.calculateVersion("v")
gitVersioning.apply {
refs {
considerTagsOnBranches = true
tag("v(?<tagVersion>[0-9].*)") {
version = "\${ref.tagVersion}\${dirty}"
}
branch(".+") {
version = "\${ref}-\${commit.short}\${dirty}"
}
}

rev {
version = "\${commit.short}\${dirty}"
}
}
val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG

dependencies {

implementation("org.apache.commons", "commons-collections4", "4.4")
implementation("com.github.1c-syntax", "utils", "0.5.1")

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

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

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

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

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}
Expand Down Expand Up @@ -106,10 +127,40 @@ license {
exclude("**/*.orig")
}

signing {
val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey
val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword
if (signingInMemoryKey != null) {
useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword)
sign(publishing.publications)
}
}

publishing {
repositories {
maven {
name = "sonatype"
url = if (isSnapshot)
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
else
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")

val sonatypeUsername: String? by project
val sonatypePassword: String? by project

credentials {
username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername
password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword
}
}
}

publications {
create<MavenPublication>("maven") {
from(components["java"])
if (isSnapshot && project.hasProperty("simplifyVersion")) {
version = findProperty("git.ref.slug") as String + "-SNAPSHOT"
}
pom {
description.set("Common library for 1c-syntax projects")
url.set("https://github.com/1c-syntax/bsl-common-library")
Expand Down Expand Up @@ -158,4 +209,9 @@ tasks.register("precommit") {
tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions)
.addStringOption("Xdoclint:none", "-quiet")
}

nexusStaging {
serverUrl = "https://s01.oss.sonatype.org/service/local/"
stagingProfileId = "15bd88b4d17915" // ./gradlew getStagingProfile
}
2 changes: 0 additions & 2 deletions jitpack.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/*
* This file is a part of BSL Common library.
*
* Copyright (c) 2021 - 2023
* 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;
/*
* This file is a part of BSL Common library.
*
* Copyright (c) 2021 - 2024
* 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.EqualsAndHashCode;
import lombok.Getter;
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 (c) 2021 - 2023
* Copyright (c) 2021 - 2024
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down Expand Up @@ -31,11 +31,11 @@
/**
* Варианты поддержки конфигурации поставщика
*/
@Getter
@AllArgsConstructor
public enum SupportVariant {
NOT_EDITABLE(0), EDITABLE_SUPPORT_ENABLED(1), NOT_SUPPORTED(2), NONE(99);

@Getter
private final int priority;

/**
Expand All @@ -58,9 +58,6 @@ public static SupportVariant max(Collection<SupportVariant> variants) {
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();
return result.orElse(NONE);
}
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/*
* This file is a part of BSL Common library.
*
* Copyright (c) 2021 - 2023
* 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.types;
/*
* This file is a part of BSL Common library.
*
* Copyright (c) 2021 - 2024
* 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.types;

/**
* Возможные виды конфигураций по формату данных
Expand Down
Loading

0 comments on commit 5782c49

Please sign in to comment.