Add build.gradle to easily modifying Java project with Android Studio

Change-Id: Ie030ff0a3569caa0eacfa331d21f59e5455c90ed
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 886a2d4511bdd5705595bcf4a29fb22f84c0e9aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Assam Boudjelthia 2021-01-20 16:16:35 +02:00 committed by Qt Cherry-pick Bot
parent ea8a0eb417
commit f94fbaf80a
4 changed files with 61 additions and 1 deletions

6
src/android/jar/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.gradle/
build/
gradle/
gradlew
gradlew.bat
local.properties

View File

@ -1,5 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="org.qtproject.qt.android">
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<uses-sdk android:minSdkVersion="9" />
</manifest>

View File

@ -0,0 +1,54 @@
// This is mainly used to allow Android Studio to easily read this folder as an android project.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
}
}
apply plugin: 'com.android.library'
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
// implementation 'androidx.appcompat:appcompat:1.2.0' // for androidx
}
repositories {
google()
jcenter()
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 23
targetSdkVersion 30
}
sourceSets {
main {
java.srcDir 'src/'
resources.srcDir 'libs/'
manifest.srcFile 'AndroidManifest.xml'
res.srcDirs = ['res/']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
android {
lintOptions {
abortOnError true
}
}
}

View File

@ -0,0 +1 @@
rootProject.name = "QtAndroid"