Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
Added FS sdk to Kotlin project and ensured it could compile, updated …
Browse files Browse the repository at this point in the history
…libs (#78)
  • Loading branch information
mattwear-fullstory authored Oct 27, 2021
1 parent 0658be7 commit 560f0ee
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.iml
.gradle
/local.properties
/.idea
/.idea/caches
/.idea/libraries
/.idea/modules.xml
Expand Down
2 changes: 1 addition & 1 deletion kotlin/.idea/gradle.xml

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

2 changes: 1 addition & 1 deletion kotlin/.idea/misc.xml

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

12 changes: 0 additions & 12 deletions kotlin/.idea/runConfigurations.xml

This file was deleted.

29 changes: 26 additions & 3 deletions kotlin/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'fullstory'

android {
compileSdkVersion rootProject.compilesdk_version
Expand Down Expand Up @@ -32,16 +32,39 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$rootProject.kotlin_version"
implementation "androidx.appcompat:appcompat:$rootProject.appcompat_ersion"
implementation "androidx.core:core-ktx:$rootProject.core_ktx_version"
implementation "androidx.appcompat:appcompat:$rootProject.appcompat_version"
implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraint_layout_version"
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifecycle_view_model_version"
implementation "androidx.room:room-runtime:$rootProject.room_version"
implementation "androidx.room:room-ktx:$rootProject.room_version"
implementation "androidx.multidex:multidex:$rootProject.multidex_version"
kapt "androidx.room:room-compiler:$rootProject.room_version"

testImplementation "junit:junit:$rootProject.junit_version"
androidTestImplementation "androidx.test.ext:junit:$rootProject.test_ext_junit"
androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.espresso_version"
}

Properties properties = new Properties()
if (project.rootProject.file('local.properties').canRead()) {
properties.load(project.rootProject.file("local.properties").newDataInputStream())
}

fullstory {
// add your "org" in local.properties, or set it here directly
org properties.getProperty('org')
if(org == null) throw new GradleException('ORG ID is empty, will not record! Please set org in build.gradle(app) or local.properties!')

// enable variants that you want to be instrumented by FS ( default to 'release' if not set )
if(properties.getProperty('enabledVariants') != null) {
enabledVariants properties.getProperty('enabledVariants')
}
// remove below line if you intend to instrument FS to only release builds
if(enabledVariants == null) throw new GradleException('enabledVariants is empty, will only record for release builds! If this is intentional, please remove this GradleException in build.gradle(app), otherwise please enabled debug!')

// please do not set server value here or in local.properties
if(properties.getProperty('server') != null){
server properties.getProperty('server')
}
}
8 changes: 7 additions & 1 deletion kotlin/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fullstorydev.shoppedemo">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
>

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
10 changes: 10 additions & 0 deletions kotlin/app/src/main/java/com/fullstorydev/shoppedemo/App.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.fullstorydev.shoppedemo

import androidx.multidex.MultiDexApplication

class App : MultiDexApplication() {
override fun onCreate() {
super.onCreate()
//custom code
}
}
37 changes: 19 additions & 18 deletions kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,44 @@
buildscript {
ext {
// Sdk and tools
build_tools_version = '29.0.3'
compilesdk_version = 28
build_tools_version = '30.0.2'
compilesdk_version = 30
minsdk_version = 19
targetsdk_version = 28
targetsdk_version = 30

// App dependencies
appcompat_ersion = '1.1.0'
core_ktx_version = '1.2.0'
constraint_layout_version = '1.1.3'
gradle_version = '3.6.0'
appcompat_version = '1.3.1'
constraint_layout_version = '2.1.1'
gradle_version = '7.0.3'
lifecycle_version = '2.2.0'
lifecycle_view_model_version = '2.2.0'
room_version = '2.2.5'
lifecycle_view_model_version = '2.3.1'
room_version = '2.3.0'
junit_version = '4.12'
kotlin_version = '1.3.61'
test_ext_junit = '1.1.1'
espresso_version = '3.2.0'
kotlin_version = '1.5.31'
test_ext_junit = '1.1.3'
espresso_version = '3.4.0'
multidex_version = "2.0.1"
}

repositories {
google()
jcenter()

mavenCentral()
maven { url "https://maven.fullstory.com" }
}
dependencies {
classpath "com.android.tools.build:gradle:$gradle_version"
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
classpath "com.android.tools.build:gradle:$gradle_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// always ue the latest FS version
classpath 'com.fullstory:gradle-plugin-local:1.19.1'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()

}
}
Expand Down
2 changes: 1 addition & 1 deletion kotlin/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip

0 comments on commit 560f0ee

Please sign in to comment.