Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated gradle 3.3.0 - 4.0.0 #49

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions .idea/compiler.xml

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

4 changes: 2 additions & 2 deletions .idea/kotlinc.xml

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

29 changes: 27 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ Add the following code block to in your app/build.gradle.
```groovy
buildscript {
dependencies {
classpath 'com.orhanobut.tracklytics:tracklytics-plugin:2.1.0'
classpath 'com.orhanobut.tracklytics:tracklytics-plugin:2.2.1'
}
}

apply plugin: 'com.android.application'
apply plugin: 'com.orhanobut.tracklytics' // Must be added after com.android.application

android {
...
}

apply plugin: 'com.orhanobut.tracklytics' // Must be added at end of file

```

Expand Down Expand Up @@ -249,6 +254,26 @@ Use [Bee](https://github.com/orhanobut/bee) to monitor your events
### How it works
<img src='https://github.com/orhanobut/tracklytics/blob/master/art/how_it_works.png'/>

### ProGuard

Depending on your ProGuard (DexGuard) config and usage, you may need to include the following lines in your proguard
```
-keep class com.orhanobut.tracklytics.** { *; }
-keepclassmembers class com.orhanobut.tracklytics.** { *; }
-keep interface com.orhanobut.tracklytics.** { *; }
-keep @interface com.orhanobut.tracklytics.** { *; }
-keep enum com.orhanobut.tracklytics.** { *; }
-keepattributes Attribute,FixedAttribute,FixedAttributes,RemoveSuperAttribute,TrackableAttribute,TrackEvent,TrackSuperAttribute,TransformAttribute,TransformAttributeMap
-keepattributes *Annotation*

-keepclasseswithmembers class * {
@com.orhanobut.tracklytics.TrackEvent *;
}

-dontwarn com.orhanobut.tracklytics.*

```

### Licence
<pre>
Copyright 2017 Orhan Obut
Expand Down
112 changes: 58 additions & 54 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,81 +1,85 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'org.gradle.api.plugins:gradle-nexus-plugin:0.7'
classpath 'org.aspectj:aspectjtools:1.8.10'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
ext {
kotlin_version = '1.4.30'
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'org.gradle.api.plugins:gradle-nexus-plugin:0.7'
classpath 'org.aspectj:aspectjtools:1.8.10'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

subprojects { project ->
group = GROUP
version = VERSION_NAME

apply plugin: 'checkstyle'
apply plugin: 'maven'
group = GROUP
version = VERSION_NAME

task checkstyle(type: Checkstyle) {
configFile rootProject.file('checkstyle.xml')
source 'src/main/java'
ignoreFailures false
showViolations true
include '**/*.java'
apply plugin: 'checkstyle'
apply plugin: 'maven'

classpath = files()
}
task checkstyle(type: Checkstyle) {
configFile rootProject.file('checkstyle.xml')
source 'src/main/java'
ignoreFailures false
showViolations true
include '**/*.java'

afterEvaluate {
if (project.tasks.findByName('check')) {
check.dependsOn('checkstyle')
classpath = files()
}
}

buildscript {
repositories {
google()
jcenter()
afterEvaluate {
if (project.tasks.findByName('check')) {
check.dependsOn('checkstyle')
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
}
}
}

repositories {
google()
jcenter()
}
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
delete rootProject.buildDir
}

ext {
minSdkVersion = 10
targetSdkVersion = 26
compileSdkVersion = 26
buildToolsVersion = "28.0.3"
sourceCompatibilityVersion = JavaVersion.VERSION_1_7
targetCompatibilityVersion = JavaVersion.VERSION_1_7
minSdkVersion = 10
targetSdkVersion = 26
compileSdkVersion = 26
buildToolsVersion = "28.0.3"
sourceCompatibilityVersion = JavaVersion.VERSION_1_7
targetCompatibilityVersion = JavaVersion.VERSION_1_7
}

ext.deps = [

// AspectJ
aspectjRuntime: "org.aspectj:aspectjrt:1.8.10",
aspectjTools : "org.aspectj:aspectjtools:1.8.10",
// AspectJ
aspectjRuntime: "org.aspectj:aspectjrt:1.8.10",
aspectjTools : "org.aspectj:aspectjtools:1.8.10",

// Test dependencies
junit : 'junit:junit:4.12',
truth : 'com.google.truth:truth:0.28',
mockito : "org.mockito:mockito-core:1.10.19"
// Test dependencies
junit : 'junit:junit:4.12',
truth : 'com.google.truth:truth:0.28',
mockito : "org.mockito:mockito-core:1.10.19"
]
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=2.1.0
VERSION_NAME=2.2.1
GROUP=com.orhanobut.tracklytics

POM_DESCRIPTION=Android analytics tracklytics
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jan 22 16:58:26 MSK 2019
#Thu Feb 25 17:33:23 MSK 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
1 change: 1 addition & 0 deletions library_module/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
55 changes: 55 additions & 0 deletions library_module/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.orhanobut.tracklytics'

buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.orhanobut.tracklytics:tracklytics-plugin:2.2.1'
}
}

repositories {
// mavenCentral()

// NOTE: This is only needed when developing the plugin!
mavenLocal()
}

android {
compileSdkVersion 29
buildToolsVersion "28.0.3"

compileOptions {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}

defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}

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

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

}
Empty file.
21 changes: 21 additions & 0 deletions library_module/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.github.library_view

import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.github.library_view.test", appContext.packageName)
}
}
5 changes: 5 additions & 0 deletions library_module/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.library_view">

/
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.github.library_view;

import com.orhanobut.tracklytics.TrackEvent;

public class LibraryModuleJavaObject {

@TrackEvent("library_module_event_java")
public void track() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.github.library_view

import com.orhanobut.tracklytics.TrackEvent

class LibraryModuleKotlinObject {
@TrackEvent("library_module_event_kotlin")
fun track() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.github.library_view

import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
Loading