Skip to content

Commit 3ea7045

Browse files
committed
Configure release
1 parent 34ca9ed commit 3ea7045

File tree

15 files changed

+165
-34
lines changed

15 files changed

+165
-34
lines changed

.editorconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
trim_trailing_whitespace = true
6+
insert_final_newline = true
7+
indent_size = 4
8+
max_line_length = 120
9+
10+
[*.{yml,yaml,json}]
11+
indent_size = 2
12+
13+
[*.{kt,kts}]
14+
ktlint_standard_annotation = disabled
15+
ktlint_standard_package-name = disabled
16+
ktlint_standard_no-wildcard-imports = disabled
17+
ktlint_standard_no-consecutive-blank-lines = disabled
18+
ktlint_standard_function-signature = disabled
19+
ktlint_standard_argument-list-wrapping = disabled
20+
ktlint_standard_parameter-list-wrapping = disabled
21+
ktlint_standard_trailing-comma-on-call-site = disabled
22+
ktlint_standard_trailing-comma-on-declaration-site = disabled
23+
ktlint_standard_string-template-indent = disabled
24+
ktlint_standard_multiline-expression-wrapping = disabled
25+
ktlint_standard_no-empty-first-line-in-class-body = disabled
26+
ktlint_standard_no-blank-line-in-list = disabled
27+
ktlint_standard_blank-line-before-declaration = disabled
File renamed without changes.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
.idea/
88
.gradle
99
out/
10-
build/
10+
build/

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
exclude: .key$
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.5.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: fix-byte-order-marker
10+
- id: mixed-line-ending
11+
- id: check-merge-conflict
12+
- id: check-case-conflict
13+
14+
- repo: https://github.com/Lucas-C/pre-commit-hooks
15+
rev: v1.5.4
16+
hooks:
17+
- id: remove-crlf
18+
- id: remove-tabs

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Romanov Alexey
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Пропуск вызова метода в тестах
1+
[![Build project](https://github.com/Romanow/skip-method/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/Romanow/skip-method/actions/workflows/build.yml)
22

3-
[![Build project](https://github.com/Romanow/skip-method/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Romanow/skip-method/actions/workflows/main.yml)
3+
# Пропуск вызова метода в тестах
44

55
## Задача
66

@@ -54,4 +54,4 @@ class IntegerProvider : ObjectProvider<Int> {
5454

5555
```shell
5656
$ ./gradlew clean build -PskipOn=DEV
57-
```
57+
```

_config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
title: Пропуск вызова метода в тестах
2+
description: Пропуск вызова метода в тестах
3+
author:
4+
name: Romanow
5+
email: romanowalex@mail.ru
6+
7+
show_downloads: false
8+
remote_theme: jekyll/minima
9+
header_pages: ['']
10+
exclude:
11+
- report/*
12+
13+
minima:
14+
skin: classic
15+
social_links:
16+
- { platform: linkedin, user_url: "https://www.linkedin.com/company/it-enduro" }
17+
- { platform: telegram, user_url: "https://t.me/romanowalex" }
18+
- { platform: youtube, user_url: "https://www.youtube.com/@it_enduro" }

build.gradle

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
plugins {
22
id "idea"
3-
id "org.jetbrains.kotlin.jvm" version "1.7.10"
3+
id "jacoco"
4+
id "maven-publish"
5+
id "org.jetbrains.kotlin.jvm" version "1.9.22"
6+
id "org.jlleitschuh.gradle.ktlint" version "12.1.1"
47
}
58

69
[compileKotlin, compileTestKotlin]*.kotlinOptions*.jvmTarget = "17"
710

811
ext {
9-
junitVersion = "5.7.0"
12+
junitVersion = "5.11.0"
1013
mockitoVersion = "3.5.11"
1114
assertjVersion = "3.19.0"
1215
aspectjVersion = "1.9.20"
@@ -20,6 +23,10 @@ idea {
2023
}
2124
}
2225

26+
ktlint {
27+
version.set("1.1.1")
28+
}
29+
2330
repositories {
2431
mavenCentral()
2532
}
@@ -49,4 +56,48 @@ test {
4956
"java.base/java.lang=ALL-UNNAMED",
5057
"-javaagent:${configurations.aspectjWeaverAgent.singleFile}"
5158
}
52-
}
59+
}
60+
61+
jacocoTestReport {
62+
reports {
63+
xml.required = true
64+
html.required = false
65+
}
66+
}
67+
68+
check.dependsOn jacocoTestReport
69+
70+
publishing {
71+
publications {
72+
maven(MavenPublication) {
73+
pom {
74+
name = "playwright-page-object"
75+
description = "Page Object pattern for Playwright framework"
76+
licenses {
77+
license {
78+
name = "The MIT License"
79+
url = "https://opensource.org/license/mit"
80+
}
81+
}
82+
developers {
83+
developer {
84+
name = "Romanov Alex"
85+
email = "romanowalex@mail.ru"
86+
}
87+
}
88+
scm {
89+
url = "https://github.com/Romanow/playwright-page-object/"
90+
}
91+
}
92+
}
93+
}
94+
repositories {
95+
maven {
96+
url = uri("https://maven.pkg.github.com/Romanow/playwright-page-object")
97+
credentials {
98+
username = System.getenv("GITHUB_USER")
99+
password = System.getenv("GITHUB_TOKEN")
100+
}
101+
}
102+
}
103+
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version=1.0.0
2-
group=ru.romanow.skip
3-
org.gradle.daemon=true
2+
group=ru.romanow.skip.method
3+
org.gradle.daemon=true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rootProject.name = "skip-method"
1+
rootProject.name = "skip-method"

src/main/kotlin/ru/romanow/skip/SkipMethod.kt renamed to src/main/kotlin/ru/romanow/skip/method/SkipMethod.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.romanow.skip
1+
package ru.romanow.skip.method
22

33
import kotlin.reflect.KClass
44

src/main/kotlin/ru/romanow/skip/SkipMethodAspect.kt renamed to src/main/kotlin/ru/romanow/skip/method/SkipMethodAspect.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.romanow.skip
1+
package ru.romanow.skip.method
22

33
import org.aspectj.lang.ProceedingJoinPoint
44
import org.aspectj.lang.annotation.Around
@@ -11,7 +11,7 @@ import kotlin.reflect.full.createInstance
1111
class SkipMethodAspect {
1212
private val skipOn = System.getProperty("skipOn")
1313

14-
@Pointcut("@annotation(ru.romanow.skip.SkipMethod)")
14+
@Pointcut("@annotation(ru.romanow.skip.method.SkipMethod)")
1515
fun withStepAnnotation() {
1616
}
1717

@@ -36,4 +36,4 @@ class SkipMethodAspect {
3636
joinPoint.proceed()
3737
}
3838
}
39-
}
39+
}

src/main/resources/META-INF/aop.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<aspectj>
22
<aspects>
3-
<aspect name="ru.romanow.skip.SkipMethodAspect"/>
3+
<aspect name="ru.romanow.skip.method.SkipMethodAspect"/>
44
</aspects>
5-
</aspectj>
5+
</aspectj>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
package ru.romanow.skip
1+
package ru.romanow.skip.method
22

33
import org.assertj.core.api.Assertions.assertThat
44
import org.junit.jupiter.api.Test
5-
import ru.romanow.skip.SkipMethod.Environments.*
5+
import ru.romanow.skip.method.SkipMethod.Environments.DEV
6+
import ru.romanow.skip.method.SkipMethod.Environments.PROD
67

7-
class SimpleTest {
8+
internal class SkipMethodTest {
89

910
@Test
1011
fun testSkipOnAll() {
@@ -29,29 +30,24 @@ fun skipOnAll(): Int {
2930
return 100
3031
}
3132

32-
class IntegerProvider : ObjectProvider<Int> {
33-
override fun generate(): Int {
34-
return 10
35-
}
36-
}
37-
3833
@SkipMethod(skipOn = [DEV], valueProvider = StringProvider::class)
3934
fun skipOnDev(): String {
4035
return "Hello, world"
4136
}
4237

43-
class StringProvider : ObjectProvider<String> {
44-
override fun generate(): String {
45-
return "default"
46-
}
47-
48-
}
49-
5038
@SkipMethod(skipOn = [PROD], valueProvider = VoidProvider::class)
5139
fun skipOnProd(arr: Array<Int>) {
5240
arr.reverse()
5341
}
5442

43+
class IntegerProvider : ObjectProvider<Int> {
44+
override fun generate() = 10
45+
}
46+
47+
class StringProvider : ObjectProvider<String> {
48+
override fun generate() = "default"
49+
}
50+
5551
class VoidProvider : ObjectProvider<Unit> {
5652
override fun generate() {}
57-
}
53+
}

0 commit comments

Comments
 (0)