Skip to content

Commit 60cde88

Browse files
authored
Merge pull request #13 from bmwcarit/update-app-dependencies
Update sample app to latest tools/SDK
2 parents c8df885 + 3d0e013 commit 60cde88

File tree

9 files changed

+74
-66
lines changed

9 files changed

+74
-66
lines changed

app/build.gradle

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,60 @@
66
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
77
// -------------------------------------------------------------------------
88

9-
apply plugin: 'com.android.application'
10-
apply plugin: 'kotlin-android'
11-
apply plugin: 'kotlin-android-extensions'
9+
plugins {
10+
id 'com.android.application'
11+
id 'org.jetbrains.kotlin.android'
12+
id 'io.github.bmwcarit.RaCoPlugin'
13+
}
1214

1315
android {
14-
compileSdkVersion 29
15-
buildToolsVersion "29.0.2"
16+
compileSdk 33
1617

1718
defaultConfig {
1819
applicationId "com.bmwgroup.ramsessample.fragments"
19-
// at least sdk version 24 is needed because of java.util.concurrent.CompletableFuture support
20-
minSdkVersion 24
21-
// this is current project sdk version
22-
targetSdkVersion 29
20+
minSdk 26
21+
targetSdk 32
22+
versionCode 1
23+
versionName "1.0"
24+
25+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
26+
}
27+
28+
buildFeatures {
29+
viewBinding true
2330
}
2431

2532
buildTypes {
2633
release {
27-
signingConfig signingConfigs.debug
34+
minifyEnabled false
35+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2836
}
2937
}
30-
3138
compileOptions {
3239
sourceCompatibility JavaVersion.VERSION_1_8
3340
targetCompatibility JavaVersion.VERSION_1_8
3441
}
35-
36-
aaptOptions {
37-
noCompress "ramses", "rlogic"
42+
kotlinOptions {
43+
jvmTarget = '1.8'
44+
}
45+
androidResources {
46+
noCompress 'ramses', 'rlogic'
3847
}
48+
3949
}
4050

4151
dependencies {
42-
implementation fileTree(dir: 'libs', include: ['*.jar'])
43-
implementation 'androidx.appcompat:appcompat:1.2.0'
44-
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
45-
implementation "androidx.fragment:fragment:1.2.0"
46-
implementation 'com.google.android.material:material:1.1.0'
47-
implementation "androidx.navigation:navigation-fragment-ktx:2.2.1"
48-
implementation "androidx.navigation:navigation-ui-ktx:2.2.1"
52+
53+
implementation 'androidx.core:core-ktx:1.9.0'
54+
implementation 'androidx.appcompat:appcompat:1.5.1'
55+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
56+
implementation "androidx.fragment:fragment:1.5.2"
57+
implementation 'com.google.android.material:material:1.6.1'
58+
implementation "androidx.navigation:navigation-fragment-ktx:2.5.2"
59+
implementation "androidx.navigation:navigation-ui-ktx:2.5.2"
4960
implementation "io.github.bmwcarit:ramses-aar:1.1.0"
5061
}
5162

52-
apply plugin: 'io.github.bmwcarit.RaCoPlugin'
5363

5464
raCoConfig {
5565
//UNCOMMENT the line below and the dependency at the bottom of the file after the path to RaCoHeadless is set.

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
android:roundIcon="@mipmap/ramseslogo_round"
1919
android:supportsRtl="true"
2020
android:theme="@style/AppTheme">
21-
<activity android:name=".MainActivity">
21+
<activity android:name=".MainActivity" android:exported="false">
2222
<intent-filter>
2323
<action android:name="android.intent.action.MAIN" />
2424

app/src/main/java/com/bmwgroup/ramsessample/fragments/FragmentLogo.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
package com.bmwgroup.ramsessample.fragments
99

1010
import android.os.Bundle
11-
import android.view.*
11+
import android.view.LayoutInflater
12+
import android.view.View
13+
import android.view.ViewGroup
1214
import androidx.fragment.app.Fragment
1315

1416
class FragmentLogo : Fragment() {

app/src/main/java/com/bmwgroup/ramsessample/fragments/MainActivity.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,25 @@ import androidx.navigation.NavController
1313
import androidx.navigation.fragment.NavHostFragment
1414
import androidx.navigation.fragment.findNavController
1515
import androidx.navigation.ui.setupWithNavController
16-
import kotlinx.android.synthetic.main.activity_main.*
16+
import com.bmwgroup.ramsessample.fragments.databinding.ActivityMainBinding
1717

1818
/*
1919
This sample app automatically loads a Ramses scene and a Ramses logic engine from its assets
2020
folder on startup, creates a full screen renderer und shows a static scene.
2121
*/
2222
class MainActivity : AppCompatActivity() {
2323
private lateinit var navController: NavController
24+
private lateinit var binding: ActivityMainBinding
2425

2526
override fun onCreate(savedInstanceState: Bundle?) {
2627
super.onCreate(savedInstanceState)
27-
setContentView(R.layout.activity_main)
28+
binding = ActivityMainBinding.inflate(layoutInflater)
29+
val view = binding.root
30+
setContentView(view)
2831

2932
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
3033
navController = navHostFragment.findNavController()
3134

32-
bottom_nav.setupWithNavController(navController)
35+
binding.bottomNav.setupWithNavController(navController)
3336
}
3437
}

build.gradle

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,11 @@
66
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
77
// -------------------------------------------------------------------------
88

9-
buildscript {
10-
apply from: "${project.rootDir}/repositories.gradle"
11-
12-
repositories globalRepositoryDefinition
13-
14-
dependencies {
15-
classpath 'com.android.tools.build:gradle:4.1.1'
16-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
17-
classpath "io.github.bmwcarit:ramses-composer-gradle-plugin:0.3.1"
18-
19-
// NOTE: Do not place your application dependencies here; they belong
20-
// in the individual module build.gradle files
21-
}
22-
}
23-
24-
allprojects {
25-
repositories globalRepositoryDefinition
9+
plugins {
10+
id 'com.android.application' version '7.2.2' apply false
11+
id 'com.android.library' version '7.2.2' apply false
12+
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
13+
id 'io.github.bmwcarit.RaCoPlugin' version '0.3.1' apply false
2614
}
2715

2816
task clean(type: Delete) {

gradle.properties

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// -------------------------------------------------------------------------
2-
// Copyright (C) 2021 BMW AG
3-
// -------------------------------------------------------------------------
4-
// This Source Code Form is subject to the terms of the Mozilla Public
5-
// License, v. 2.0. If a copy of the MPL was not distributed with this
6-
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
7-
// -------------------------------------------------------------------------
1+
# -------------------------------------------------------------------------
2+
# Copyright (C) 2021 BMW AG
3+
# -------------------------------------------------------------------------
4+
# This Source Code Form is subject to the terms of the Mozilla Public
5+
# License, v. 2.0. If a copy of the MPL was not distributed with this
6+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
7+
# -------------------------------------------------------------------------
8+
89

910
# Specifies the JVM arguments used for the daemon process.
1011
# The setting is particularly useful for tweaking memory settings.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ distributionBase=GRADLE_USER_HOME
1111
distributionPath=wrapper/dists
1212
zipStoreBase=GRADLE_USER_HOME
1313
zipStorePath=wrapper/dists
14-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
14+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip

repositories.gradle

Lines changed: 0 additions & 13 deletions
This file was deleted.

settings.gradle

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,22 @@
66
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
77
// -------------------------------------------------------------------------
88

9+
pluginManagement {
10+
repositories {
11+
gradlePluginPortal()
12+
google()
13+
mavenCentral()
14+
}
15+
}
16+
17+
dependencyResolutionManagement {
18+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
19+
repositories {
20+
google()
21+
mavenCentral()
22+
gradlePluginPortal()
23+
}
24+
}
25+
26+
rootProject.name = "RamsesSampleApp"
927
include ':app'
10-
rootProject.name='RamsesSampleAppKotlin'

0 commit comments

Comments
 (0)