Skip to content

Commit e3b5c1d

Browse files
committed
Finish v0.6.0
2 parents e45dac2 + 74920ec commit e3b5c1d

File tree

23 files changed

+885
-242
lines changed

23 files changed

+885
-242
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "gradle" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
12+
groups:
13+
freefair:
14+
patterns:
15+
- "io.freefair.*"
16+
- package-ecosystem: "github-actions"
17+
directory: "/"
18+
schedule:
19+
interval: "daily"

.github/workflows/gradle.yml renamed to .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: ['11', '13']
11+
java_version: ['17', '20']
1212
os: [ubuntu-latest, windows-latest, macOS-latest]
1313
steps:
1414
- uses: actions/checkout@v1
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to Sonatype
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches:
8+
- develop
9+
workflow_dispatch:
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up JDK
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: 17
20+
distribution: 'liberica'
21+
- name: Publish to Sonatype
22+
run: ./gradlew publishMavenPublicationToSonatypeRepository -PsimplifyVersion
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
26+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
27+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
28+
ORG_GRADLE_PROJECT_signingInMemoryPassword: ${{ secrets.GPG_SIGNING_PASSWORD }}
29+
- name: Close repository
30+
if: github.event_name == 'release'
31+
run: ./gradlew closeAndReleaseRepository
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
35+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
36+
ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.SONATYPE_USERNAME }}
37+
ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.SONATYPE_PASSWORD }}

.github/workflows/release.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.idea/compiler.xml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 416 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
# 1c-syntax utils
2+
3+
Common utils for 1c-syntax team java projects

build.gradle.kts

Lines changed: 139 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,59 @@
1-
import me.qoomon.gradle.gitversioning.GitVersioningPluginConfig
2-
import me.qoomon.gradle.gitversioning.GitVersioningPluginConfig.CommitVersionDescription
3-
import me.qoomon.gradle.gitversioning.GitVersioningPluginConfig.VersionDescription
1+
import me.qoomon.gitversioning.commons.GitRefType
42
import java.util.Calendar
53

64
plugins {
7-
java
8-
jacoco
9-
maven
5+
`java-library`
106
`maven-publish`
11-
id("com.github.hierynomus.license") version "0.15.0"
12-
id("io.franzbecker.gradle-lombok") version "3.2.0"
13-
id("me.qoomon.git-versioning") version "2.1.1"
7+
jacoco
8+
signing
9+
id("org.cadixdev.licenser") version "0.6.1"
10+
id("me.qoomon.git-versioning") version "6.4.3"
11+
id("com.gorylenko.gradle-git-properties") version "2.4.1"
12+
id("io.freefair.lombok") version "8.6"
13+
id("io.freefair.javadoc-links") version "8.6"
14+
id("io.freefair.javadoc-utf-8") version "8.6"
15+
id("io.freefair.maven-central.validate-poms") version "8.6"
1416
id("com.github.ben-manes.versions") version "0.27.0"
17+
id("ru.vyarus.pom") version "3.0.0"
18+
id("io.codearte.nexus-staging") version "0.30.0"
1519
}
1620

17-
group = "com.github.1c-syntax"
21+
group = "io.github.1c-syntax"
22+
gitVersioning.apply {
23+
refs {
24+
considerTagsOnBranches = true
25+
tag("v(?<tagVersion>[0-9].*)") {
26+
version = "\${ref.tagVersion}\${dirty}"
27+
}
28+
branch(".+") {
29+
version = "\${ref}-\${commit.short}\${dirty}"
30+
}
31+
}
32+
33+
rev {
34+
version = "\${commit.short}\${dirty}"
35+
}
36+
}
37+
val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG
1838

1939
repositories {
2040
mavenCentral()
2141
}
2242

23-
val junitVersion = "5.6.0"
43+
val junitVersion = "5.7.0"
2444

2545
dependencies {
26-
27-
compileOnly("org.projectlombok", "lombok", lombok.version)
28-
46+
compileOnly("com.github.spotbugs:spotbugs-annotations:4.8.3")
2947
testImplementation("org.junit.jupiter", "junit-jupiter-api", junitVersion)
3048
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", junitVersion)
31-
32-
testImplementation("org.assertj", "assertj-core", "3.14.0")
49+
testImplementation("org.assertj", "assertj-core", "3.18.1")
3350
}
3451

3552
java {
36-
sourceCompatibility = JavaVersion.VERSION_11
37-
targetCompatibility = JavaVersion.VERSION_11
53+
sourceCompatibility = JavaVersion.VERSION_17
54+
targetCompatibility = JavaVersion.VERSION_17
3855
withSourcesJar()
56+
withJavadocJar()
3957
}
4058

4159
tasks.withType<JavaCompile> {
@@ -52,51 +70,128 @@ tasks.test {
5270
}
5371

5472
reports {
55-
html.isEnabled = true
73+
html.required.set(true)
5674
}
5775
}
5876

59-
6077
tasks.check {
6178
dependsOn(tasks.jacocoTestReport)
6279
}
6380

6481
tasks.jacocoTestReport {
6582
reports {
66-
xml.isEnabled = true
67-
xml.destination = File("$buildDir/reports/jacoco/test/jacoco.xml")
83+
xml.required.set(true)
84+
xml.outputLocation.set(File("$buildDir/reports/jacoco/test/jacoco.xml"))
6885
}
6986
}
7087

7188
license {
72-
header = rootProject.file("license/HEADER.txt")
89+
header(rootProject.file("license/HEADER.txt"))
90+
newLine(false)
7391
ext["year"] = "2018-" + Calendar.getInstance().get(Calendar.YEAR)
7492
ext["name"] = "Alexey Sosnoviy <labotamy@gmail.com>, Nikita Fedkin <nixel2007@gmail.com>"
7593
ext["project"] = "1c-syntax utils"
76-
strictCheck = true
77-
mapping("java", "SLASHSTAR_STYLE")
7894
exclude("**/*.properties")
7995
exclude("**/*.xml")
8096
exclude("**/*.json")
8197
exclude("**/*.bsl")
8298
}
8399

84-
gitVersioning.apply(closureOf<GitVersioningPluginConfig> {
85-
preferTags = true
86-
branch(closureOf<VersionDescription> {
87-
pattern = "^(?!v[0-9]+).*"
88-
versionFormat = "\${branch}-\${commit.short}\${dirty}"
89-
})
90-
tag(closureOf<VersionDescription>{
91-
pattern = "v(?<tagVersion>[0-9].*)"
92-
versionFormat = "\${tagVersion}\${dirty}"
93-
})
94-
commit(closureOf<CommitVersionDescription>{
95-
versionFormat = "\${commit.short}\${dirty}"
96-
})
97-
})
98-
99-
lombok {
100-
version = "1.18.10"
101-
sha256 = "2836e954823bfcbad45e78c18896e3d01058e6f643749810c608b7005ee7b2fa"
102-
}
100+
tasks.javadoc {
101+
options {
102+
this as StandardJavadocDocletOptions
103+
noComment(false)
104+
}
105+
}
106+
107+
artifacts {
108+
archives(tasks["jar"])
109+
archives(tasks["sourcesJar"])
110+
archives(tasks["javadocJar"])
111+
}
112+
113+
signing {
114+
val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey
115+
val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword
116+
if (signingInMemoryKey != null) {
117+
useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword)
118+
sign(publishing.publications)
119+
}
120+
}
121+
122+
publishing {
123+
repositories {
124+
maven {
125+
name = "sonatype"
126+
url = if (isSnapshot)
127+
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
128+
else
129+
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
130+
131+
val sonatypeUsername: String? by project
132+
val sonatypePassword: String? by project
133+
134+
credentials {
135+
username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername
136+
password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword
137+
}
138+
}
139+
}
140+
publications {
141+
create<MavenPublication>("maven") {
142+
from(components["java"])
143+
144+
if (isSnapshot && project.hasProperty("simplifyVersion")) {
145+
version = findProperty("git.ref.slug") as String + "-SNAPSHOT"
146+
}
147+
148+
pom {
149+
description.set("Common utils for 1c-syntax team java projects")
150+
url.set("https://github.com/1c-syntax/utils")
151+
licenses {
152+
license {
153+
name.set("GNU LGPL 3")
154+
url.set("https://www.gnu.org/licenses/lgpl-3.0.txt")
155+
distribution.set("repo")
156+
}
157+
}
158+
developers {
159+
developer {
160+
id.set("asosnoviy")
161+
name.set("Alexey Sosnoviy")
162+
email.set("labotamy@gmail.com")
163+
url.set("https://github.com/asosnoviy")
164+
organization.set("1c-syntax")
165+
organizationUrl.set("https://github.com/1c-syntax")
166+
}
167+
developer {
168+
id.set("nixel2007")
169+
name.set("Nikita Fedkin")
170+
email.set("nixel2007@gmail.com")
171+
url.set("https://github.com/nixel2007")
172+
organization.set("1c-syntax")
173+
organizationUrl.set("https://github.com/1c-syntax")
174+
}
175+
developer {
176+
id.set("theshadowco")
177+
name.set("Valery Maximov")
178+
email.set("maximovvalery@gmail.com")
179+
url.set("https://github.com/theshadowco")
180+
organization.set("1c-syntax")
181+
organizationUrl.set("https://github.com/1c-syntax")
182+
}
183+
}
184+
scm {
185+
connection.set("scm:git:git://github.com/1c-syntax/utils.git")
186+
developerConnection.set("scm:git:git@github.com:1c-syntax/utils.git")
187+
url.set("https://github.com/1c-syntax/utils")
188+
}
189+
}
190+
}
191+
}
192+
}
193+
194+
nexusStaging {
195+
serverUrl = "https://s01.oss.sonatype.org/service/local/"
196+
stagingProfileId = "15bd88b4d17915" // ./gradlew getStagingProfile
197+
}

gradle/wrapper/gradle-wrapper.jar

6.27 KB
Binary file not shown.

0 commit comments

Comments
 (0)