Skip to content

Commit

Permalink
Merge pull request #13 from bmwcarit/update-app-dependencies
Browse files Browse the repository at this point in the history
Update sample app to latest tools/SDK
  • Loading branch information
violinyanev authored Sep 22, 2022
2 parents c8df885 + 3d0e013 commit 60cde88
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 66 deletions.
54 changes: 32 additions & 22 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,60 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// -------------------------------------------------------------------------

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'io.github.bmwcarit.RaCoPlugin'
}

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdk 33

defaultConfig {
applicationId "com.bmwgroup.ramsessample.fragments"
// at least sdk version 24 is needed because of java.util.concurrent.CompletableFuture support
minSdkVersion 24
// this is current project sdk version
targetSdkVersion 29
minSdk 26
targetSdk 32
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildFeatures {
viewBinding true
}

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

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

aaptOptions {
noCompress "ramses", "rlogic"
kotlinOptions {
jvmTarget = '1.8'
}
androidResources {
noCompress 'ramses', 'rlogic'
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation "androidx.fragment:fragment:1.2.0"
implementation 'com.google.android.material:material:1.1.0'
implementation "androidx.navigation:navigation-fragment-ktx:2.2.1"
implementation "androidx.navigation:navigation-ui-ktx:2.2.1"

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.fragment:fragment:1.5.2"
implementation 'com.google.android.material:material:1.6.1'
implementation "androidx.navigation:navigation-fragment-ktx:2.5.2"
implementation "androidx.navigation:navigation-ui-ktx:2.5.2"
implementation "io.github.bmwcarit:ramses-aar:1.1.0"
}

apply plugin: 'io.github.bmwcarit.RaCoPlugin'

raCoConfig {
//UNCOMMENT the line below and the dependency at the bottom of the file after the path to RaCoHeadless is set.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:roundIcon="@mipmap/ramseslogo_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
package com.bmwgroup.ramsessample.fragments

import android.os.Bundle
import android.view.*
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment

class FragmentLogo : Fragment() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,25 @@ import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.fragment.findNavController
import androidx.navigation.ui.setupWithNavController
import kotlinx.android.synthetic.main.activity_main.*
import com.bmwgroup.ramsessample.fragments.databinding.ActivityMainBinding

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

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
binding = ActivityMainBinding.inflate(layoutInflater)
val view = binding.root
setContentView(view)

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

bottom_nav.setupWithNavController(navController)
binding.bottomNav.setupWithNavController(navController)
}
}
22 changes: 5 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,11 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// -------------------------------------------------------------------------

buildscript {
apply from: "${project.rootDir}/repositories.gradle"

repositories globalRepositoryDefinition

dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
classpath "io.github.bmwcarit:ramses-composer-gradle-plugin:0.3.1"

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

allprojects {
repositories globalRepositoryDefinition
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
id 'io.github.bmwcarit.RaCoPlugin' version '0.3.1' apply false
}

task clean(type: Delete) {
Expand Down
15 changes: 8 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// -------------------------------------------------------------------------
// Copyright (C) 2021 BMW AG
// -------------------------------------------------------------------------
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# Copyright (C) 2021 BMW AG
# -------------------------------------------------------------------------
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# -------------------------------------------------------------------------


# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
13 changes: 0 additions & 13 deletions repositories.gradle

This file was deleted.

19 changes: 18 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,22 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// -------------------------------------------------------------------------

pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = "RamsesSampleApp"
include ':app'
rootProject.name='RamsesSampleAppKotlin'

0 comments on commit 60cde88

Please sign in to comment.