Skip to content

Commit

Permalink
Merge pull request #13 from dzmpr/feat/TRCKR-T-10_public_api_validation
Browse files Browse the repository at this point in the history
TRCKR-MR-10 public api validation
  • Loading branch information
dzmpr authored May 7, 2023
2 parents b046f0d + dbf03a4 commit a7f8855
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 43 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space

[*.{kt,kts}]
indent_size = 4
ij_continuation_indent_size = 4
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_name_count_to_use_star_import = 9999
ij_kotlin_name_count_to_use_star_import_for_members = 9999

[*.{yml,yaml}]
indent_size = 2
ij_yaml_indent_sequence_value = false
62 changes: 31 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,41 @@ jobs:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'

- name: Publish artifacts to maven central
run: ./gradlew publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USER }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASS }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASS }}
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'

- name: Publish artifacts to maven central
run: ./gradlew publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USER }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASS }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASS }}

release:
name: Create github release
needs: publish
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Read version
run: |
version=$(cat trckr.version | tr -d '\n')
echo "version=$version" >> $GITHUB_ENV
- name: Create release
uses: softprops/action-gh-release@v1
with:
body_path: ${{ github.workspace }}/changelog.md
name: v${{ env.version }}
tag_name: v${{ env.version }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3

- name: Read version
run: |
version=$(cat trckr.version | tr -d '\n')
echo "version=$version" >> $GITHUB_ENV
- name: Create release
uses: softprops/action-gh-release@v1
with:
body_path: ${{ github.workspace }}/changelog.md
name: v${{ env.version }}
tag_name: v${{ env.version }}
token: ${{ secrets.GITHUB_TOKEN }}
25 changes: 14 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ jobs:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'

- name: Run tests
# Temporary run tests only for JVM target, because ios/watchos/tvos tests fail.
# TODO: https://youtrack.jetbrains.com/issue/KT-54814
run: ./gradlew jvmTest
- name: Check public API
run: ./gradlew apiCheck

- name: Run tests
# Temporary run tests only for JVM target, because ios/watchos/tvos tests fail.
# TODO: https://youtrack.jetbrains.com/issue/KT-54814
run: ./gradlew jvmTest
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ plugins {
alias(libs.plugins.ksp) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.binaryvalidator)
}

apiValidation {
with(ignoredProjects) {
add("trckr-demo")
add("trckr-processor")
}
nonPublicMarkers.add("ru.cookedapp.trckr.core.annotations.internal.TrckrInternal")
}

allprojects {
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### Changelog
* Add kotlin multiplatform support.
* Add public API validation.

### Dependencies
| Dependency | Version |
Expand Down
2 changes: 2 additions & 0 deletions libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ publishing = "0.22.0"
mockk = "1.13.2"
junit = "5.9.1"
compileTesting = "1.4.9"
binaryvalidator = "0.13.1"

[libraries]
ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
Expand All @@ -28,3 +29,4 @@ kotlinpoet = ["kotlinpoet", "kotlinpoet-ksp"]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
binaryvalidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryvalidator" }
109 changes: 109 additions & 0 deletions trckr-core/api/trckr-core.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
public final class ru/cookedapp/trckr/core/TrckrBuilder {
public final fun addAdapter (Lru/cookedapp/trckr/core/adapter/TrackerAdapter;)V
public final fun addParameterConverter (Lru/cookedapp/trckr/core/converter/ParameterConverter;)V
public final fun addTypeConverter (Lru/cookedapp/trckr/core/converter/TypeConverter;)V
}

public abstract interface class ru/cookedapp/trckr/core/TrckrCore {
public abstract fun track (Lru/cookedapp/trckr/core/event/TrckrEvent;)V
}

public final class ru/cookedapp/trckr/core/TrckrCoreImplKt {
public static final fun createTrckr (Lkotlin/jvm/functions/Function1;)Lru/cookedapp/trckr/core/TrckrCore;
}

public abstract interface class ru/cookedapp/trckr/core/adapter/TrackerAdapter {
public abstract fun trackEvent (Ljava/lang/String;Ljava/util/Map;)V
}

public abstract interface annotation class ru/cookedapp/trckr/core/annotations/Event : java/lang/annotation/Annotation {
public static final field Companion Lru/cookedapp/trckr/core/annotations/Event$Companion;
public static final field NAME_PROPERTY_NAME Ljava/lang/String;
public static final field SKIP_ADAPTERS_PROPERTY_NAME Ljava/lang/String;
public abstract fun name ()Ljava/lang/String;
public abstract fun skipAdapters ()[Ljava/lang/Class;
}

public final class ru/cookedapp/trckr/core/annotations/Event$Companion {
}

public abstract interface annotation class ru/cookedapp/trckr/core/annotations/Param : java/lang/annotation/Annotation {
public static final field Companion Lru/cookedapp/trckr/core/annotations/Param$Companion;
public static final field NAME_PROPERTY_NAME Ljava/lang/String;
public static final field STRATEGY_PROPERTY_NAME Ljava/lang/String;
public abstract fun name ()Ljava/lang/String;
public abstract fun strategy ()Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;
}

public final class ru/cookedapp/trckr/core/annotations/Param$Companion {
}

public abstract interface annotation class ru/cookedapp/trckr/core/annotations/Tracker : java/lang/annotation/Annotation {
}

public final class ru/cookedapp/trckr/core/annotations/data/TrackStrategy : java/lang/Enum {
public static final field DEFAULT Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;
public static final field SKIP_IF_NULL Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;
public static final field TRACK_NULL Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;
public static fun valueOf (Ljava/lang/String;)Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;
public static fun values ()[Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;
}

public abstract interface class ru/cookedapp/trckr/core/converter/ParameterConverter {
public abstract fun convert (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
}

public abstract interface class ru/cookedapp/trckr/core/converter/TypeConverter {
public abstract fun convert (Ljava/lang/Object;)Ljava/lang/Object;
}

public final class ru/cookedapp/trckr/core/event/TrckrEvent {
public fun <init> (Ljava/lang/String;Ljava/util/List;Ljava/util/List;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/util/List;
public final fun component3 ()Ljava/util/List;
public final fun copy (Ljava/lang/String;Ljava/util/List;Ljava/util/List;)Lru/cookedapp/trckr/core/event/TrckrEvent;
public static synthetic fun copy$default (Lru/cookedapp/trckr/core/event/TrckrEvent;Ljava/lang/String;Ljava/util/List;Ljava/util/List;ILjava/lang/Object;)Lru/cookedapp/trckr/core/event/TrckrEvent;
public fun equals (Ljava/lang/Object;)Z
public final fun getName ()Ljava/lang/String;
public final fun getParameters ()Ljava/util/List;
public final fun getSkipAdapters ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class ru/cookedapp/trckr/core/exceptions/TrckrBuilderException : ru/cookedapp/trckr/core/exceptions/TrckrException {
public fun <init> (Ljava/lang/String;)V
public fun getMessage ()Ljava/lang/String;
}

public final class ru/cookedapp/trckr/core/exceptions/TrckrConversionException : ru/cookedapp/trckr/core/exceptions/TrckrException {
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V
public fun toString ()Ljava/lang/String;
}

public abstract class ru/cookedapp/trckr/core/exceptions/TrckrException : java/lang/Throwable {
public fun <init> ()V
}

public final class ru/cookedapp/trckr/core/extensions/TrckrBuilderExtensionsKt {
public static final fun addAdapters (Lru/cookedapp/trckr/core/TrckrBuilder;[Lru/cookedapp/trckr/core/adapter/TrackerAdapter;)V
public static final fun addConverters (Lru/cookedapp/trckr/core/TrckrBuilder;[Lru/cookedapp/trckr/core/converter/ParameterConverter;)V
public static final fun addConverters (Lru/cookedapp/trckr/core/TrckrBuilder;[Lru/cookedapp/trckr/core/converter/TypeConverter;)V
}

public final class ru/cookedapp/trckr/core/param/TrckrParam {
public fun <init> (Ljava/lang/String;Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;Ljava/lang/Object;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;
public final fun component3 ()Ljava/lang/Object;
public final fun copy (Ljava/lang/String;Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;Ljava/lang/Object;)Lru/cookedapp/trckr/core/param/TrckrParam;
public static synthetic fun copy$default (Lru/cookedapp/trckr/core/param/TrckrParam;Ljava/lang/String;Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;Ljava/lang/Object;ILjava/lang/Object;)Lru/cookedapp/trckr/core/param/TrckrParam;
public fun equals (Ljava/lang/Object;)Z
public final fun getName ()Ljava/lang/String;
public final fun getStrategy ()Lru/cookedapp/trckr/core/annotations/data/TrackStrategy;
public final fun getValue ()Ljava/lang/Object;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

2 changes: 1 addition & 1 deletion trckr.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.1.0

0 comments on commit a7f8855

Please sign in to comment.