diff --git a/app/build.gradle b/app/build.gradle index 6eaa0d1..01a3a4e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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. diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f4fe650..1735852 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,7 +18,7 @@ android:roundIcon="@mipmap/ramseslogo_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - + diff --git a/app/src/main/java/com/bmwgroup/ramsessample/fragments/FragmentLogo.kt b/app/src/main/java/com/bmwgroup/ramsessample/fragments/FragmentLogo.kt index ef2de55..6ef2b67 100644 --- a/app/src/main/java/com/bmwgroup/ramsessample/fragments/FragmentLogo.kt +++ b/app/src/main/java/com/bmwgroup/ramsessample/fragments/FragmentLogo.kt @@ -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() { diff --git a/app/src/main/java/com/bmwgroup/ramsessample/fragments/MainActivity.kt b/app/src/main/java/com/bmwgroup/ramsessample/fragments/MainActivity.kt index 7a2fe8c..14f2442 100644 --- a/app/src/main/java/com/bmwgroup/ramsessample/fragments/MainActivity.kt +++ b/app/src/main/java/com/bmwgroup/ramsessample/fragments/MainActivity.kt @@ -13,7 +13,7 @@ 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 @@ -21,14 +21,17 @@ import kotlinx.android.synthetic.main.activity_main.* */ 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) } } diff --git a/build.gradle b/build.gradle index 48f2b74..0022bc5 100644 --- a/build.gradle +++ b/build.gradle @@ -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) { diff --git a/gradle.properties b/gradle.properties index a231ee9..11a4d92 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 93a9113..3e2a05b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/repositories.gradle b/repositories.gradle deleted file mode 100644 index 3d4f5c1..0000000 --- a/repositories.gradle +++ /dev/null @@ -1,13 +0,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/. -// ------------------------------------------------------------------------- - -ext.globalRepositoryDefinition = { - google() - mavenCentral() - gradlePluginPortal() -} diff --git a/settings.gradle b/settings.gradle index eb5c72f..6fce59f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -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'