Repository | Build Status |
---|---|
Konsist | |
Konsist Documentation | - |
- Publish Local Snapshot:
./gradlew publishToMavenLocal -Pkonsist.releaseTarget=local
publish to local ~/.m2/repository
- Publish Public Snapshot
./gradlew publish -Pkonsist.releaseTarget=snapshot
publish to snapshot repository - Publish Release
./gradlew publish -Pkonsist.releaseTarget=release
publish to release repository. This artefact will be transferred to maven central repository after some time.
- Create
hotfix/KON-XXX-...
branch frommain
- Fix the bug and open PR targeting
mian
- Merge the PR
- Create
release/vX.Y.Z
branch frommain
- Update Konsist version
- gradle.properties file
- README.md file
- Sample projects
- Open the release PR targeting
main
and wait for all checks to pass - Merge PR
- Switch to the
main
branch and pull changes - Run
./gradlew publish -Pkonsist.releaseTarget=release
on themain
branch to release a new version - Create a new GitHub release
- set
vX.Y.Z
as tag version - set
vX.Y.Z
as release title
- set
- Update Konsist version in the Konsist Quick Start docs page
- Run
/scripts/update-snippets.py
snippet to generate PR with updated snippets for Konsist Documentation - Merge
main
todevelop
- Upgrade
konist
version ondevelop
branch - Notify devs who have reported the issue (community link in original ticket)
- Merge
main
todevelop
- Create
release/vX.Y.Z
branch fromdevelop
- Update Konsist version
- gradle.properties file
- README.md file
- Remove deprecated API
- Open PR targeting
main
and wait for all checks to pass - Release local artifact and test 3rd party projects using local artifact
- Android-showcase
- Mango (internal)
- CleanArchitectureForAndroid
- Merge PR to
main
- Run
./gradlew publish -Pkonsist.releaseTarget=release
on themain
branch to release a new version - Create a new GitHub release
- set
vX.Y.Z
as tag version - set
vX.Y.Z
as release title
- set
- Update Konsist version in the Konsist Quick Start docs page
- Run
/scripts/deploy_snippets_to_kotlin_documentation_repo.py
snippet to generate PR with updated snippets for Konsist Documentation - Merge
main
todevelop
(release
branch will have changes e.g. version, deprecated APi removed...) - Notify the community about the release
- Notify devs who have reported the issue or asked for the new feature (community links in original ticket)
./gradlew dokkaHtml
- generate KDocs in./lib/build/dokka/html/index.html
We have three options:
KoXDeclaration
not implementsKoNameProvider
(e.g.KoBaseDeclaration
,KoInitBlockDeclaration
)KoXDeclaration
implementsKoNameProvider
(so it has access toname
property, e.g.KoClassDeclaration
,KoFunctionDeclaration
)- some exceptions, like:
KoKDocTagDeclaration
,KoModifier
etc.
In provider with property with type List<KoXDeclaration>
where KoXDeclaration
not implements KoNameProvider
we create:
- properties
- with prefix
num
and the name of the X item in the plural number- Specifies how many items there are.
- with prefix
- functions
- with prefix
count
and the name of the X item in the plural number withpredicate
lambda parameter- Specifies how many items satisfies given predicate.
- with prefix
has
and the name of the X item in the plural number- Specifies whether declaration has any item.
- with prefix
has
and the name of the X item in the singular number withpredicate
lambda parameter- Specifies whether declaration has at least one item that satisfies given predicate.
- with prefix
hasAll
and the name of the X item in the plural number withpredicate
lambda parameter- Specifies whether declaration has all items that satisfies given predicate.
- with prefix
In provider with property with type List<KoXDeclaration>
where KoXDeclaration
implements KoNameProvider
we create
all properties and functions from the Option 1
and also:
- functions
- with prefix
has
, the name of the X item in the singular number and suffixWithName
and with parameters:(name: String, vararg names: String)
- Specifies whether the declaration has at least one item whose name matches any of the specified names
- with prefix
has
and the name of the X item in the plural number and suffixWithAllNames
and with parameters:(name: String, vararg names: String)
- Specifies whether the declaration has items with all the specified names
- with prefix
In this option we have providers for which it makes no sense to pass predicate
lambda parameter, especially if the
list contains enum values. Instead of passing lambda parameter, we pass concrete enums.
- properties
- with prefix
num
and the name of the X item in the plural number- Specifies how many items there are.
- with prefix
- functions
- with prefix
has
and the name of the X item in the plural number- Specifies whether declaration has any item.
- with prefix
has
and the name of the X item in the singular number with parameters:(koXDeclaration: KoXDeclaration, vararg koXDeclarations: KoXDeclaration)
- Specifies whether declaration has at least one specified item.
- with prefix
hasAll
and the name of the X item in the plural number with parameters:(koXDeclaration: KoXDeclaration, vararg koXDeclarations: KoXDeclaration)
- Specifies whether declaration has all specified items.
- with prefix
We have the same three options like above.
For providers with property with type List<KoXDeclaration>
where KoXDeclaration
not implements KoNameProvider
we
create extensions:
- properties
- with the name of the X item in the plural number
- Mapping declaration to its items.
- with the name of the X item in the plural number
- functions
- with prefix
with/without
and the name of the X item in the plural number- Filtering declarations with/without any item.
- with prefix
with/without
and the name of the X item in the singular number withpredicate
lambda parameter (to lambda we passKoXDeclaration
)- Filtering declarations that have at least one/ not have item satisfying the provided predicate.
- with prefix
withAll/withoutAll
and the name of the X item in the plural number withpredicate
lambda parameter (to lambda we passKoXDeclaration
)- Filtering declarations that have all/have at least one item satisfying the provided predicate.
- with prefix
with/without
and the name of the X item in the plural number withpredicate
lambda parameter (to lambda we passList<KoXDeclaration>
)- Filtering declarations with/without items satisfying the provided predicate.
- with prefix
For providers with property with type List<KoXDeclaration>
where KoXDeclaration
implements KoNameProvider
we create
all properties and functions extensions from the Option 1
and also:
- functions
- with prefix
with/without
, the name of the X item in the singular number and suffixNamed
and with parameters:(name: String, vararg names: String)
- Filtering declarations that have at least one/ not have item with the specified name(s)
- with prefix
withAll/withoutAll
and the name of the X item in the plural number and suffixNamed
and with parameters:(name: String, vararg names: String)
- Filtering declarations that have all/ not have any items with the specified name(s)
- with prefix
For such providers we create extensions:
- properties
- with the name of the X item in the plural number
- Mapping declaration to its items.
- with the name of the X item in the plural number
- functions
- with prefix
with/without
and the name of the X item in the plural number- Filtering declarations with/without any item.
- with prefix
with/without
, the name of the X item in the singular number with parameters:(koXDeclaration: KoXDeclaration, vararg koXDeclarations: KoXDeclaration)
- Filtering declarations that have at least one/not have the specified item
- with prefix
withAll/withoutAll
, the name of the X item in the plural number with parameters:(koXDeclaration: KoXDeclaration, vararg koXDeclarations: KoXDeclaration)
- Filtering declarations that have all/not have any the specified item
- with prefix
Examples of such providers: KoTypeProvider
, KoReturnTypeProvider
.
We create extensions:
- properties
- with the name of the X item in the plural number
- Mapping declaration to its item.
- with the name of the X item in the plural number
- functions
- with prefix
with/without
and the name of the property in the singular number withpredicate
lambda parameter- Filtering declarations that have/ not have item satisfying the provided predicate.
- with prefix
E.g. In KoNameProvider
, the name
property returns String
(singular - it's one object),
so we create two extensions:
withName(name: String, vararg names: String)
withoutName(name: String, vararg names: String)
and if it makes sense:
withName(predicate: (String) -> Boolean)
withoutName(predicate: (String) -> Boolean)
E.g. In KoAliasProvider
, the alias
property returns String?
(singular - it's one object:
String
or null ),
so we create two extensions:
withAlias(vararg names: String)
withoutAlias(vararg names: String)
The difference is that in the first case we force passing the parameter, in the second it is optional.
If parameters of extensions is of KClass
type, then we create analogous extensions like for providers not implementing KoNameProvider
but with suffix Of
!
Error
No matching variant of project :buildSrc was found. The consumer was configured to find a library for use during runtime, compatible with Java 17, packaged as a jar,
Fix
Change Gradle version File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
We take the test method name from Thread.currentThread().stackTrace[index].methodName
which has a different behavior
due to the way assert
is called (depending on whether we use default parameters values or not in the assertTrue
or assertFalse
method).
- If we don't use any of the default parameters (we set them directly) the stack trace looks like this: So the test method name is at the fourth index.
- If we use any parameter with a default value (we don't set any of them directly) the stack trace looks like this: So the test method name is at the fifth index.