Skip to content

Commit

Permalink
Code Architecture Refactoring.
Browse files Browse the repository at this point in the history
1. hide Provider is called and delete the singleton of the provider;
2. provider is now in TrackerContext;
3. add shutdown method;
3. user spotless format code;
  • Loading branch information
cpacm committed Aug 1, 2023
1 parent 4a11af0 commit 870ae16
Show file tree
Hide file tree
Showing 471 changed files with 6,069 additions and 6,366 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ jobs:
- name: Before script
run: |
chmod +x gradlew
chmod +x config/checkstyle/checkstyle.sh
chmod +x gradle/publishAllToMavenLocal.sh
- name: Run Gradle command
run: |
bash ./gradlew spotlessCheck
bash ./gradle/publishAllToMavenLocal.sh
bash ./config/checkstyle/checkstyle.sh
# ./gradlew lint
# ./gradlew assembleDebug
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
Expand Down
39 changes: 25 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ plugins {
alias libs.plugins.protobuf apply false

alias libs.plugins.growingio.plugin apply false

alias libs.plugins.spotless apply false
}

apply from: "${rootProject.projectDir}/gradle/sonarcloud.gradle"
Expand All @@ -43,22 +45,31 @@ allprojects {
}
}

subprojects { project ->
apply plugin: 'checkstyle'
//./gradlew spotlessCheck ==> check code
//./gradlew spotlessApply ==> format code
subprojects {
apply plugin: "com.diffplug.spotless"
spotless {
java {
target '**/*.java'
licenseHeaderFile rootProject.file('gradle/java.header')

task checkstyle(type: Checkstyle, group: 'check') {
configFile file("${rootDir}/config/checkstyle/checkstyle.xml")
configProperties.checkstyleJavaHeader = file("${rootDir}/config/checkstyle/java.header")
source 'src/main/java', 'src/test/java', 'src/androidTest/java'
ignoreFailures false
showViolations true
include '**/*.java'
classpath = files()
}
removeUnusedImports()
}
kotlin {
target '**/*.kt'
targetExclude("$buildDir/**/*.kt")

ktlint()
licenseHeaderFile rootProject.file('gradle/java.header')
}
groovyGradle {
target '*.gradle'
greclipse()
}

afterEvaluate {
if (project.tasks.findByName('check')) {
check.dependsOn('checkstyle')
format 'xml', {
target '**/*.xml'
}
}
}
23 changes: 0 additions & 23 deletions config/checkstyle/checkstyle.sh

This file was deleted.

171 changes: 0 additions & 171 deletions config/checkstyle/checkstyle.xml

This file was deleted.

42 changes: 21 additions & 21 deletions demos/demo-autotrack/build.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion buildConfiguration.compileVersion
defaultConfig {
minSdkVersion buildConfiguration.minSdkVersion
targetSdkVersion buildConfiguration.targetSdkVersion
}

lintOptions {
abortOnError false
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion buildConfiguration.compileVersion
defaultConfig {
minSdkVersion buildConfiguration.minSdkVersion
targetSdkVersion buildConfiguration.targetSdkVersion
}

lintOptions {
abortOnError false
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {

implementation libs.bundles.android.support
implementation libs.bundles.android.support

implementation(name: 'tbs_sdk_44051', ext: 'jar')
implementation(name: 'tbs_sdk_44051', ext: 'jar')

debugApi project(':gio-sdk:autotracker')
releaseApi libs.growingio.autotracker
//api "com.growingio.android:autotracker:3.3.1"
debugApi project(':gio-sdk:autotracker')
releaseApi libs.growingio.autotracker
//api "com.growingio.android:autotracker:3.3.1"

implementation project(':demo-core')
implementation project(':demo-core')

compileOnly libs.androidx.appcompat
compileOnly libs.androidx.appcompat
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Beijing Yishu Technology Co., Ltd.
* Copyright (C) 2023 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.
Expand All @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.gio.test.three.autotrack;

import android.app.Activity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Beijing Yishu Technology Co., Ltd.
* Copyright (C) 2023 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.
Expand All @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.gio.test.three.autotrack.activity;

import android.app.Activity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Beijing Yishu Technology Co., Ltd.
* Copyright (C) 2023 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.
Expand All @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.gio.test.three.autotrack.activity;

import android.app.Activity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Beijing Yishu Technology Co., Ltd.
* Copyright (C) 2023 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.
Expand All @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.gio.test.three.autotrack.activity;

import android.app.Activity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Beijing Yishu Technology Co., Ltd.
* Copyright (C) 2023 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.
Expand All @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.gio.test.three.autotrack.activity;

import android.app.Activity;
Expand Down
Loading

0 comments on commit 870ae16

Please sign in to comment.