diff --git a/.gitignore b/.gitignore index b98f2cd..7304ea1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ /build /local.properties /*.iml +gradlew +gradlew.bat +gradle/wrapper \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 88aebce..22d63ca 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,32 +1,37 @@ -apply plugin: 'com.android.application' +plugins { + alias(libs.plugins.android.application) +} android { - compileSdkVersion 10 - buildToolsVersion "25.0.2" + namespace 'com.github.ma1co.pmcademo.app' + //noinspection GradleDependency + compileSdk 16 defaultConfig { applicationId "com.github.ma1co.pmcademo.app" - minSdkVersion 10 - targetSdkVersion 10 + minSdk 16 + //noinspection ExpiredTargetSdkVersion + targetSdk 16 versionCode "git -C ${projectDir} rev-list --first-parent --count HEAD".execute().text.trim().toInteger() versionName "git -C ${projectDir} describe --always --tags --dirty".execute().text.trim().replaceAll("^v", "") } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - } -} - -android.applicationVariants.all { variant -> - variant.outputs.each { output -> - def apkName = "PMCADemo-${output.baseName}-${variant.versionName}.apk" - output.outputFile = new File(output.outputFile.parent, apkName) + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { - compile 'com.github.ma1co.OpenMemories-Framework:framework:-SNAPSHOT' - provided 'com.github.ma1co.OpenMemories-Framework:stubs:-SNAPSHOT' - compile 'com.nanohttpd:nanohttpd:2.1.1' + // OpenMemories-Framework + implementation libs.ma1co.openmemories.framework + // If you need direct access to the Sony APIs, you can add this line, too: + compileOnly libs.ma1co.openmemories.stubs + implementation libs.nanohttpd + + android.applicationVariants.all { variant -> + variant.outputs.all { + outputFileName = "PMCADemo-${variant.baseName}-${variant.versionName}(${variant.versionCode}).apk" + } + } } diff --git a/build.gradle b/build.gradle index 8e53332..c9bd2b2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,4 @@ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' - } -} - -allprojects { - repositories { - jcenter() - maven { - url "https://jitpack.io" - } - } +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { +alias(libs.plugins.android.application) apply false } diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..4387edc --- /dev/null +++ b/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..304b85c --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,13 @@ +[versions] +agp = "8.7.3" +nanohttpd = "2.1.1" +openMemoriesFramework = "-SNAPSHOT" + +[libraries] +ma1co-openmemories-framework = { group = "com.github.ma1co.OpenMemories-Framework", name = "framework", version.ref = "openMemoriesFramework" } +ma1co-openmemories-stubs = { group = "com.github.ma1co.OpenMemories-Framework", name = "stubs", version.ref = "openMemoriesFramework" } +nanohttpd = { group = "com.nanohttpd", name = "nanohttpd", version.ref = "nanohttpd" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } + diff --git a/settings.gradle b/settings.gradle index e7b4def..122cb85 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,25 @@ -include ':app' +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + maven { url "https://jitpack.io" } + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven { url "https://jitpack.io" } + } +} + +rootProject.name = "PMCADemo" +include ':app' \ No newline at end of file