Skip to content

Commit

Permalink
Merge pull request #53 from infinum/develop
Browse files Browse the repository at this point in the history
Release 1.3.0.
  • Loading branch information
bojankoma authored Aug 21, 2021
2 parents 6f5843a + 5a73832 commit 8b237ad
Show file tree
Hide file tree
Showing 27 changed files with 264 additions and 154 deletions.
5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Change Log
==========

## Version 1.3.0

_2021-08-23_

* Add custom Lint checks.
* Fix R8 collisions on obfuscated class names.

## Version 1.2.9

_2021-08-21_

* Update dependencies.

## Version 1.2.8

_2021-07-22_
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The project is organized in the following modules:
- `ui` - contains a single screen UI that provides visual tracking of sent events
- `ui-no-op` - contains a stub for easy release implementation of UI package
- `generator` - contains a generator code for provided tracking plan
- `lint` - contains custom Lint checks
- `sample` - a sample app for testing the Gradle plugin

## Usage
Expand All @@ -30,7 +31,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.infinum.collar:collar-plugin:1.2.8"
classpath "com.infinum.collar:collar-plugin:1.3.0"
}
}
```
Expand All @@ -41,7 +42,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.infinum.collar:collar-plugin:1.2.8")
classpath("com.infinum.collar:collar-plugin:1.3.0")
}
}
```
Expand Down Expand Up @@ -243,6 +244,12 @@ javaCompileOptions {
}
```

## Lint checks

_Collar_ plugin provides it's own custom Lint checks. These can be disabled, suppressed or fixed like any other Lint registered issues.
Checks:
- `MissingScreenNameAnnotation` - All Activities and Fragments require a valid screen name annotation on the class. You must annotate an Activity or Fragment with @ScreenName with a valid value parameter or set enabled parameter to false.

## Debug UI

![UI](ui.png)![ui-dark](ui-dark.png)
Expand All @@ -253,13 +260,13 @@ You can search, filter and clear all sent analytics.
In your app `build.gradle` or `build.gradle.kts` add:
**Groovy**
```gradle
debugImplementation "com.infinum.collar:collar-ui:1.2.8"
releaseImplementation "com.infinum.collar:collar-ui-no-op:1.2.8"
debugImplementation "com.infinum.collar:collar-ui:1.3.0"
releaseImplementation "com.infinum.collar:collar-ui-no-op:1.3.0"
```
**KotlinDSL**
```kotlin
debugImplementation("com.infinum.collar:collar-ui:1.2.8")
releaseImplementation("com.infinum.collar:collar-ui-no-op:1.2.8")
debugImplementation("com.infinum.collar:collar-ui:1.3.0")
releaseImplementation("com.infinum.collar:collar-ui-no-op:1.3.0")
```

In order to start tracking with UI you must use _LiveCollector_ as in this example:
Expand Down Expand Up @@ -343,8 +350,7 @@ To run the task you can:
## Contributing

Feedback and code contributions are very much welcome. Just make a pull request with a short description of your changes. By making contributions to this project you give permission for your code to be used under the same [license](LICENSE).
For easier developing a `sample` application with proper implementations is provided.
It is also recommended to uncomment the block of dependency substitution in project level `build.gradle`.
For easier developing a `sample` application with proper implementations is provided.

## License

Expand Down
38 changes: 8 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,20 @@ buildscript {
}

dependencies {
classpath libs.gradle
classpath libs.kotlin.plugin
classpath libs.serialization.plugin
classpath libs.tools.gradle
classpath libs.kotlin.gradle
classpath libs.serialization.gradle
classpath libs.cpd
classpath libs.detekt.plugin
classpath libs.detekt.gradle
classpath libs.ktlint
classpath libs.dokka
}
}

subprojects {
def buildProperties = new Properties()
file(rootDir.absolutePath + "/build.properties").withInputStream { buildProperties.load(it) }
if (buildProperties.getProperty("build.debug").toBoolean()) {
configurations.all {
resolutionStrategy {
dependencySubstitution {
def libraryannotations = libs.libraryannotations.get()
def librarycore = libs.librarycore.get()
def libraryui = libs.libraryui.get()
def libraryuinoop = libs.libraryuinoop.get()
def libraryprocessor = libs.libraryprocessor.get()
def librarygenerator = libs.librarygenerator.get()
def libraryplugin = libs.libraryplugin.get()

substitute module(libraryannotations.getModule().toString() + ":" + libraryannotations.getVersionConstraint().toString()) with project(':annotations')
substitute module(librarycore.getModule().toString() + ":" + librarycore.getVersionConstraint().toString()) with project(':core')
substitute module(libraryui.getModule().toString() + ":" + libraryui.getVersionConstraint().toString()) with project(':ui')
substitute module(libraryuinoop.getModule().toString() + ":" + libraryuinoop.getVersionConstraint().toString()) with project(':ui-no-op')
substitute module(libraryprocessor.getModule().toString() + ":" + libraryprocessor.getVersionConstraint().toString()) with project(':processor')
substitute module(librarygenerator.getModule().toString() + ":" + librarygenerator.getVersionConstraint().toString()) with project(':generator')
substitute module(libraryplugin.getModule().toString() + ":" + libraryplugin.getVersionConstraint().toString()) with project(':plugin')
}
}
}
}

repositories {
google()
mavenLocal()
mavenCentral()
}

Expand Down Expand Up @@ -80,6 +55,7 @@ task lintAll(dependsOn: [

task detektAll(dependsOn: [
':annotations:detekt',
':lint:detekt',
':core:detekt',
':ui:detekt',
':ui-no-op:detekt',
Expand All @@ -93,6 +69,7 @@ task detektAll(dependsOn: [

task ktlintAll(dependsOn: [
':annotations:ktlintCheck',
':lint:ktlintCheck',
':core:ktlintCheck',
':ui:ktlintCheck',
':ui-no-op:ktlintCheck',
Expand All @@ -106,6 +83,7 @@ task ktlintAll(dependsOn: [

task cpdAll(dependsOn: [
':annotations:cpdCheck',
':lint:cpdCheck',
':core:cpdCheck',
':ui:cpdCheck',
':ui-no-op:cpdCheck',
Expand Down
1 change: 0 additions & 1 deletion build.properties

This file was deleted.

4 changes: 2 additions & 2 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ext {
]
releaseConfig = [
"group" : "com.infinum.collar",
"version" : "1.2.8",
"versionCode": 1 * 100 * 100 + 2 * 100 + 8
"version" : "1.3.0",
"versionCode": 1 * 100 * 100 + 3 * 100 + 0
]
}
1 change: 1 addition & 0 deletions core/proguard-rules.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-keeppackagenames
-keep public class com.infinum.collar.* {
public protected *;
}
39 changes: 31 additions & 8 deletions deploy.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
task deployAnnotations(dependsOn: [
':annotations:clean',
':annotations:publishReleasePublicationToGithubRepository',
':annotations:publishReleasePublicationToSonatypeRepository'
]) {
group = "Deploy"
description = "Deploy module to repositories"
}

task deployLint(dependsOn: [
':lint:clean',
':lint:publishReleasePublicationToSonatypeRepository'
]) {
group = "Deploy"
description = "Deploy module to repositories"
}

task deployCore(dependsOn: [
':core:clean',
':core:publishReleasePublicationToGithubRepository',
':core:publishReleasePublicationToSonatypeRepository'
]) {
group = "Deploy"
Expand All @@ -18,7 +24,6 @@ task deployCore(dependsOn: [

task deployUi(dependsOn: [
':ui:clean',
':ui:publishReleasePublicationToGithubRepository',
':ui:publishReleasePublicationToSonatypeRepository'
]) {
group = "Deploy"
Expand All @@ -27,7 +32,6 @@ task deployUi(dependsOn: [

task deployUiNoOp(dependsOn: [
':ui-no-op:clean',
':ui-no-op:publishReleasePublicationToGithubRepository',
':ui-no-op:publishReleasePublicationToSonatypeRepository'
]) {
group = "Deploy"
Expand All @@ -36,7 +40,6 @@ task deployUiNoOp(dependsOn: [

task deployProcessor(dependsOn: [
':processor:clean',
':processor:publishReleasePublicationToGithubRepository',
':processor:publishReleasePublicationToSonatypeRepository'
]) {
group = "Deploy"
Expand All @@ -45,7 +48,6 @@ task deployProcessor(dependsOn: [

task deployGenerator(dependsOn: [
':generator:clean',
':generator:publishReleasePublicationToGithubRepository',
':generator:publishReleasePublicationToSonatypeRepository'
]) {
group = "Deploy"
Expand All @@ -54,7 +56,6 @@ task deployGenerator(dependsOn: [

task deployPlugin(dependsOn: [
':plugin:clean',
':plugin:publishReleasePublicationToGithubRepository',
':plugin:publishReleasePublicationToSonatypeRepository'
]) {
group = "Deploy"
Expand All @@ -63,6 +64,7 @@ task deployPlugin(dependsOn: [

task deployStage1(dependsOn: [
'deployAnnotations',
'deployLint',
'deployGenerator'
]) {
group = "Deploy"
Expand All @@ -77,7 +79,6 @@ task deployStage2(dependsOn: [
description = "Deploy all stage 2 modules to repositories"
}


task deployStage3(dependsOn: [
'deployUi',
'deployUiNoOp',
Expand All @@ -86,3 +87,25 @@ task deployStage3(dependsOn: [
group = "Deploy"
description = "Deploy all stage 3 modules to repositories"
}

task deployDebug(dependsOn: [
':annotations:clean',
':lint:clean',
':core:clean',
':ui:clean',
':ui-no-op:clean',
':processor:clean',
':generator:clean',
':plugin:clean',
':annotations:publishReleasePublicationToMavenLocal',
':lint:publishReleasePublicationToMavenLocal',
':core:publishReleasePublicationToMavenLocal',
':ui:publishReleasePublicationToMavenLocal',
':ui-no-op:publishReleasePublicationToMavenLocal',
':processor:publishReleasePublicationToMavenLocal',
':generator:publishReleasePublicationToMavenLocal',
':plugin:publishReleasePublicationToMavenLocal',
]) {
group = "Deploy"
description = "Deploy all modules to Maven Local repository"
}
32 changes: 18 additions & 14 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
[versions]
collar = "1.2.8"
gradle = "4.2.2"
collar = "1.3.0"
gradle = "7.0.1"
lint = "30.0.1"
kotlin = "1.5.21"
coroutines = "1.5.1"
serialization = "1.2.1"
serialization = "1.2.2"
poet = "1.9.0"
annotations = "21.0.1"
core = "1.6.0"
appcompat = "1.3.0"
activity = "1.2.3"
fragment = "1.3.5"
appcompat = "1.3.1"
activity = "1.3.1"
fragment = "1.3.6"
lifecycle = "2.3.1"
recyclerview = "1.2.1"
room = "2.3.0"
startup = "1.0.0"
startup = "1.1.0"
dynamicanimation = "1.0.0"
design = "1.4.0"
koin = "3.1.2"
timber = "4.7.1"
detekt = "1.17.1"
timber = "5.0.0"
detekt = "1.18.0"
ktlint = "10.1.0"
cpd = "3.1"
dokka = "1.5.0"
Expand All @@ -27,20 +28,23 @@ dokka = "1.5.0"
libraryannotations = { module = "com.infinum.collar:collar-annotations", version.ref = "collar" }
librarycore = { module = "com.infinum.collar:collar-core", version.ref = "collar" }
libraryprocessor = { module = "com.infinum.collar:collar-processor", version.ref = "collar" }
libraryplugin = { module = "com.infinum.collar:collar-plugin", version.ref = "collar" }
librarygradle = { module = "com.infinum.collar:collar-plugin", version.ref = "collar" }
librarygenerator = { module = "com.infinum.collar:collar-generator", version.ref = "collar" }
libraryui = { module = "com.infinum.collar:collar-ui", version.ref = "collar" }
libraryuinoop = { module = "com.infinum.collar:collar-ui-no-op", version.ref = "collar" }

gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
tools-gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
tools-lintapi = { module = "com.android.tools.lint:lint-api", version.ref = "lint" }
tools-lintchecks = { module = "com.android.tools.lint:lint-tests", version.ref = "lint" }
tools-linttests = { module = "com.android.tools.lint:lint-checks", version.ref = "lint" }

kotlin-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-core = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }

coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }

serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
serialization-gradle = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }

annotations = { module = "org.jetbrains:annotations-java5", version.ref = "annotations" }
Expand Down Expand Up @@ -68,7 +72,7 @@ koin = { module = "io.insert-koin:koin-android", version.ref = "koin" }

timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }

detekt-plugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
detekt-gradle = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }

ktlint = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 8b237ad

Please sign in to comment.