Skip to content

Commit

Permalink
Feat/autotracker (#154)
Browse files Browse the repository at this point in the history
* v3.4.0版本
1. 移除 inject-annotation 模块;
2. 移除 growingio-autotracker-gradle-plugin 模块;
以上两个模块代码请到 https://github.com/growingio/growingio-sdk-android-plugin 查看;
3. 添加 FirebaseAnalyticsAdapter;
4. 添加 GoogleAnalyticsAdapter;
5. fix: 不触发INSTANT事件时,cache事件不被发送
6. feat: 还原eventName取值逻辑
7. fix: add order by
Co-authored-by: styluo <shu_jiahuili@foxmail.com>
  • Loading branch information
cpacm authored Jul 6, 2022
1 parent 8769c36 commit 2508fc8
Show file tree
Hide file tree
Showing 149 changed files with 2,525 additions and 4,680 deletions.
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ buildscript {
]

releaseConfiguration = [
releaseVersion : "3.3.6",
releaseVersionCode: 30306,
releaseVersion : "3.4.0",
releaseVersionCode: 30400,
]

versions = [
Expand All @@ -36,6 +36,7 @@ buildscript {

'androidx' : [
'appcompat' : 'androidx.appcompat:appcompat:1.3.1',
'material' : 'com.google.android.material:material:1.6.0',
'fragment' : 'androidx.fragment:fragment:1.3.1',
'recyclerview' : 'androidx.recyclerview:recyclerview:1.2.1',
"swiperefreshlayout": "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0",
Expand All @@ -52,6 +53,8 @@ buildscript {
'annotation' : "com.growingio.android:annotation:$releaseConfiguration.releaseVersion",
'compiler' : "com.growingio.android:compiler:$releaseConfiguration.releaseVersion",

'analytics-fa' : "com.growingio.android:analytics-fa:$releaseConfiguration.releaseVersion",
'analytics-ga' : "com.growingio.android:analytics-ga:$releaseConfiguration.releaseVersion",
'hybrid' : "com.growingio.android:hybrid:$releaseConfiguration.releaseVersion",
'okhttp3' : "com.growingio.android:okhttp3:$releaseConfiguration.releaseVersion",
'database' : "com.growingio.android:database:$releaseConfiguration.releaseVersion",
Expand Down Expand Up @@ -123,7 +126,7 @@ buildscript {
'asm_tree' : 'org.ow2.asm:asm-tree:9.1',
],
]
kotlin_version = '1.4.32'
kotlin_version = '1.6.10'
}

repositories {
Expand Down
5 changes: 3 additions & 2 deletions config/checkstyle/checkstyle.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

./gradlew :growingio-autotracker-gradle-plugin:checkstyle \
&& ./gradlew :growingio-annotation:checkstyle \
./gradlew :growingio-annotation:checkstyle \
&& ./gradlew :growingio-annotation:compiler:checkstyle \
&& ./gradlew :growingio-tracker-core:checkstyle \
&& ./gradlew :growingio-autotracker-core:checkstyle \
Expand All @@ -17,6 +16,8 @@
&& ./gradlew :growingio-tools:crash:checkstyle \
&& ./gradlew :growingio-tools:oaid:checkstyle \
&& ./gradlew :growingio-tools:snappy:checkstyle \
&& ./gradlew :growingio-adapter:analytics-fa:checkstyle \
&& ./gradlew :growingio-adapter:analytics-ga:checkstyle \
&& ./gradlew :gio-sdk:tracker:checkstyle \
&& ./gradlew :gio-sdk:tracker-cdp:checkstyle \
&& ./gradlew :gio-sdk:autotracker:checkstyle \
Expand Down
17 changes: 6 additions & 11 deletions demos/demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'jacoco'

def withAutotrack = true

if (withAutotrack) {
apply plugin: 'com.growingio.android.autotracker'
}
apply plugin: 'com.growingio.android.autotracker'

buildscript {
repositories {
Expand All @@ -16,7 +12,7 @@ buildscript {
}
dependencies {
classpath "com.growingio.android:autotracker-gradle-plugin:${releaseConfiguration.releaseVersion}"
//classpath "com.growingio.android:autotracker-gradle-plugin:3.3.1"
//classpath "com.growingio.android:autotracker-gradle-plugin:3.4.0"
}
}

Expand All @@ -27,8 +23,6 @@ android {
minSdkVersion 26
targetSdkVersion buildConfiguration.targetSdkVersion

buildConfigField "boolean", "withAutotrack", "$withAutotrack"

testInstrumentationRunner "com.growingio.autotest.TrackAndroidJUnitRunner"

testInstrumentationRunnerArguments listener: "com.growingio.autotest.TrackTestRunListener"
Expand Down Expand Up @@ -76,9 +70,10 @@ android {
}

growingAutotracker {
development true
logEnabled true
// excludePackages "com.gio.test.three.autotrack.fragments", "com.example"
skipDependencyCheck true
//includePackages "com.growingio.android.plugin"
//excludePackages "com.cpacm"
}

dependencies {
Expand Down Expand Up @@ -110,7 +105,7 @@ dependencies {
compileOnly libraries.androidx.appcompat

// leakcanary 避免发版前未使用Profiler进行内存泄漏检测
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
}

apply from: "${rootProject.projectDir}/gradle/jacoco.gradle"
8 changes: 4 additions & 4 deletions gradle/jacoco.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def coverageSourceDirs = [
"$rootDir/growingio-annotation/src/main/java",
"$rootDir/growingio-tracker-core/src/main/java",
"$rootDir/growingio-autotracker-core/src/main/java",
"$rootDir/growingio-autotracker-gradle-plugin/src/main/java",
"$rootDir/growingio-data/encoder/src/main/java",
"$rootDir/growingio-data/json/src/main/java",
"$rootDir/growingio-data/protobuf/src/main/java",
Expand All @@ -20,13 +19,14 @@ def coverageSourceDirs = [
"$rootDir/growingio-network/okhttp3/src/main/java",
"$rootDir/growingio-network/volley/src/main/java",
"$rootDir/growingio-network/urlconnection/src/main/java",
"$rootDir/growingio-adapter/analytics-fa/src/main/java",
"$rootDir/growingio-adapter/analytics-ga/src/main/java",
"$rootDir/growingio-tools/crash/src/main/java",
"$rootDir/growingio-tools/snappy/src/main/java",
"$rootDir/growingio-tools/oaid/src/main/java",
"$rootDir/growingio-webservice/circler/src/main/java",
"$rootDir/growingio-webservice/debugger/src/main/java",
"$rootDir/growingio-annotation/compiler/src/main/java",
"$rootDir/inject-annotation/compiler/src/main/java",
// "$rootDir/gio-sdk/tracker/src/main/java",
// "$rootDir/gio-sdk/tracker-cdp/src/main/java",
// "$rootDir/gio-sdk/autotracker/src/main/java",
Expand All @@ -38,7 +38,6 @@ def coverageClassDirs = [
"$rootDir/growingio-annotation/build/intermediates/javac/debug/classes",
"$rootDir/growingio-tracker-core/build/intermediates/javac/debug/classes",
"$rootDir/growingio-autotracker-core/build/intermediates/javac/debug/classes",
"$rootDir/growingio-autotracker-gradle-plugin/build/intermediates/javac/debug/classes",
"$rootDir/growingio-data/encoder/build/intermediates/javac/debug/classes",
"$rootDir/growingio-data/json/build/intermediates/javac/debug/classes",
"$rootDir/growingio-data/protobuf/build/intermediates/javac/debug/classes",
Expand All @@ -49,11 +48,12 @@ def coverageClassDirs = [
"$rootDir/growingio-tools/crash/build/intermediates/javac/debug/classes",
"$rootDir/growingio-tools/snappy/build/intermediates/javac/debug/classes",
"$rootDir/growingio-tools/oaid/build/intermediates/javac/debug/classes",
"$rootDir/growingio-adapter/analytics-fa/build/intermediates/javac/debug/classes",
"$rootDir/growingio-adapter/analytics-ga/build/intermediates/javac/debug/classes",
"$rootDir/growingio-webservice/circler/build/intermediates/javac/debug/classes",
"$rootDir/growingio-webservice/debugger/build/intermediates/javac/debug/classes",
"$rootDir/growingio-hybrid/build/intermediates/javac/debug/classes",
"$rootDir/growingio-annotation/compiler/build/classes/java/main",
"$rootDir/inject-annotation/compiler/build/classes/java/main",
// "$rootDir/gio-sdk/tracker/build/intermediates/javac/debug/classes",
// "$rootDir/gio-sdk/tracker-cdp/build/intermediates/javac/debug/classes",
// "$rootDir/gio-sdk/autotracker/build/intermediates/javac/debug/classes",
Expand Down
3 changes: 2 additions & 1 deletion gradle/publishAllToMavenLocal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ export IS_EXCLUDE_DEMOS=true
&& ./gradlew :growingio-webservice:circler:publishMavenAgentPublicationToMavenLocal \
&& ./gradlew :growingio-tools:crash:publishMavenAgentPublicationToMavenLocal \
&& ./gradlew :growingio-tools:oaid:publishMavenAgentPublicationToMavenLocal \
&& ./gradlew :growingio-adapter:analytics-fa:publishMavenAgentPublicationToMavenLocal \
&& ./gradlew :growingio-adapter:analytics-ga:publishMavenAgentPublicationToMavenLocal \
&& ./gradlew :gio-sdk:tracker:publishMavenAgentPublicationToMavenLocal \
&& ./gradlew :gio-sdk:tracker-cdp:publishMavenAgentPublicationToMavenLocal \
&& ./gradlew :gio-sdk:autotracker:publishMavenAgentPublicationToMavenLocal \
&& ./gradlew :gio-sdk:autotracker-cdp:publishMavenAgentPublicationToMavenLocal \
&& ./gradlew :growingio-autotracker-gradle-plugin:publishMavenAgentPublicationToMavenLocal \
&& ./gradlew clean
export IS_EXCLUDE_DEMOS=false
8 changes: 0 additions & 8 deletions gradle/publishAutotrackerPluginToMavenLocal.sh

This file was deleted.

File renamed without changes.
59 changes: 59 additions & 0 deletions growingio-adapter/analytics-fa/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
plugins {
id 'com.android.library'
}

android {
compileSdkVersion buildConfiguration.compileVersion
defaultConfig {
minSdkVersion 19
targetSdkVersion buildConfiguration.targetSdkVersion
versionName releaseConfiguration.releaseVersion
versionCode releaseConfiguration.releaseVersionCode
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility buildConfiguration.sourceCompatibility
targetCompatibility buildConfiguration.targetCompatibility
}

testOptions {
unitTests.all {
jacoco {
includeNoLocationClasses = true
excludes = ['jdk.internal.*']
}
}
unitTests {
returnDefaultValues = true
includeAndroidResources = true
}
}
}


dependencies {
testImplementation libraries.test.junit
testImplementation libraries.test.truth
testImplementation libraries.test.androidx_core
testImplementation libraries.test.robolectric

testImplementation platform('com.google.firebase:firebase-bom:30.0.1')
testImplementation 'com.google.firebase:firebase-analytics-ktx'

implementation project(':growingio-tracker-core')

implementation project(":growingio-annotation")
annotationProcessor project(":growingio-annotation:compiler")

compileOnly platform('com.google.firebase:firebase-bom:30.0.1')
compileOnly 'com.google.firebase:firebase-analytics-ktx'
}
apply from: "${rootProject.projectDir}/gradle/publishMaven.gradle"
apply from: "${rootProject.projectDir}/gradle/jacocoModule.gradle"
Empty file.
4 changes: 4 additions & 0 deletions growingio-adapter/analytics-fa/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POM_NAME=analytics-fa
POM_ARTIFACT_ID=analytics-fa
POM_PACKAGING=aar
POM_DESCRIPTION=Adapter Google Analytics data to Growingio's sdk.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
21 changes: 21 additions & 0 deletions growingio-adapter/analytics-fa/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2020 Beijing Yishu Technology Co., Ltd.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.growingio.android.analytics.firebase">

</manifest>
Loading

0 comments on commit 2508fc8

Please sign in to comment.