Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions DatabaseTest-RoboVM/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
apply plugin: "java"

repositories {
jcenter()
gradlePluginPortal()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}

dependencies {
compile project(":gdx-sqlite")
implementation project(":DatabaseTest")
implementation project(":gdx-sqllite-robovm")

compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
implementation "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
implementation "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
implementation "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
}

sourceSets.main.java.srcDirs = [ "src/" ]
Expand Down
12 changes: 5 additions & 7 deletions DatabaseTest-android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gdxsqlite.test" >

<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="17" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
</manifest>
54 changes: 31 additions & 23 deletions DatabaseTest-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ configurations { natives }

repositories {
/** The default repository for Android Studio projects */
jcenter()
gradlePluginPortal()
}

dependencies {
compile project(":DatabaseTest")
implementation project(":DatabaseTest")
implementation project(":gdx-sqlite-android")

compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
Expand All @@ -23,7 +23,7 @@ android {
buildToolsVersion android_version

defaultConfig {
minSdkVersion 9
minSdkVersion 16
targetSdkVersion android_compile_version
versionCode 1
versionName "1.0.0"
Expand Down Expand Up @@ -75,26 +75,34 @@ task run(type: Exec) {
// called every time gradle gets executed, takes the native dependencies of
// the natives configuration, and extracts them to the proper libs/ folders
// so they get packed with the APK.
task copyAndroidNatives() {
file("libs/armeabi/").mkdirs();
file("libs/armeabi-v7a/").mkdirs();
file("libs/x86/").mkdirs();
file("libs/x86_64/").mkdirs();
file("libs/arm64-v8a/").mkdirs();
task copyAndroidNatives {
doFirst {
file("libs/armeabi/").mkdirs()
file("libs/armeabi-v7a/").mkdirs()
file("libs/x86/").mkdirs()
file("libs/x86_64/").mkdirs()
file("libs/arm64-v8a/").mkdirs()

configurations.natives.files.each { jar ->
def outputDir = null
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if (jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if (outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
configurations.natives.copy().files.each { jar ->
def outputDir = null
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if (jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if (outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
}

tasks.whenTaskAdded { packageTask ->
if (packageTask.name.contains("package")) {
packageTask.dependsOn 'copyAndroidNatives'
}
}
9 changes: 5 additions & 4 deletions DatabaseTest-desktop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ apply plugin: "java"

sourceCompatibility = 1.7
sourceSets.main.java.srcDirs = [ "src/" ]
sourceSets.main.resources.srcDirs = [ "../DatabaseTest-android/assets" ]

dependencies {
compile project(":DatabaseTest")
compile project(":gdx-sqlite-desktop")
implementation project(":DatabaseTest")
implementation project(":gdx-sqlite-desktop")

compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
}
10 changes: 5 additions & 5 deletions DatabaseTest/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'java'
apply plugin: 'java-library'

sourceCompatibility = "1.7"
targetCompatibility = "1.7"

sourceSets.main.java.srcDirs = [ "src/" ]

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
api fileTree(dir: 'libs', include: ['*.jar'])

compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile project (':gdx-sqlite')
api "com.badlogicgames.gdx:gdx:$gdxVersion"
api project (':gdx-sqlite')

testCompile 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'
}
21 changes: 10 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
buildscript {
repositories {
jcenter()
gradlePluginPortal()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
google()
}
// these dependencies are for build process only (not for actual code)
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'org.wisepersist:gwt-gradle-plugin:1.1.19'
classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.18'
}
}

Expand All @@ -19,16 +19,15 @@ allprojects {
version = '1.0'
ext {
gdxVersion = '1.9.6'
roboVMVersion = '2.3.0'
roboVMVersion = '2.3.18'
// Set defaults for android
android_compile_version = 25
android_version = '25.0.1'
appcompat_library_version = '25.0.1'
support_library_version = '25.0.1'
android_compile_version = 33
android_version = '33.0.0'
}

repositories {
jcenter()
gradlePluginPortal()
maven { url 'https://maven.fabric.io/public' }
google()
}
}
31 changes: 21 additions & 10 deletions gdx-sqlite-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
apply plugin: "com.android.library"
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'maven-publish'

group = 'com.badlogic.gdx.sqlite'
version = '0.1'

dependencies {
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:${appcompat_library_version}"
testImplementation 'junit:junit:4.13.2'

compile project(":gdx-sqlite")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
api project(":gdx-sqlite")
api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
}

android {
compileSdkVersion android_compile_version
buildToolsVersion android_version

defaultConfig {
minSdkVersion 9
minSdkVersion 16
targetSdkVersion android_compile_version
versionCode 1
versionName "1.0"
Expand All @@ -38,10 +37,22 @@ android {
jniLibs.srcDirs = ['libs']
}

instrumentTest.setRoot('tests')
}
// TODO : do we really need this?
lintOptions {
abortOnError false

publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
}
}
}
}
25 changes: 21 additions & 4 deletions gdx-sqlite-desktop/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
apply plugin: "java"
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "java-library"
apply plugin: 'maven-publish'

repositories {
mavenCentral()
}

group = 'com.badlogic.gdx.sqlite'
version = '0.1'
Expand All @@ -8,6 +12,19 @@ sourceCompatibility = 1.7
sourceSets.main.java.srcDirs = [ "src/" ]

dependencies {
compile project(":gdx-sqlite")
compile "org.xerial:sqlite-jdbc:3.15.1"
api project(":gdx-sqlite")
api "org.xerial:sqlite-jdbc:3.39.2.1"
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
23 changes: 18 additions & 5 deletions gdx-sqlite/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'java'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'java-library'
apply plugin: 'maven-publish'

group = 'com.badlogic.gdx.sqlite'
version = '0.1'
Expand All @@ -10,9 +10,22 @@ sourceSets.main.java.srcDirs = [ "src/" ]


dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
api fileTree(dir: 'libs', include: ['*.jar'])

compile "com.badlogicgames.gdx:gdx:$gdxVersion"
api "com.badlogicgames.gdx:gdx:$gdxVersion"

testCompile 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
11 changes: 5 additions & 6 deletions gdx-sqlite/src/com/badlogic/gdx/sqlite/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,18 @@ public interface Database {
/** Closes the opened database and releases all the resources related to this database.
* @throws com.badlogic.gdx.sqlite.SQLiteGdxException */
public void closeDatabase () throws com.badlogic.gdx.sqlite.SQLiteGdxException;

/**
* Get a prepared statement.
*
* @param prepStat give the {@link com.badlogic.gdx.sqlite.PreparedStatement prepared statement} to use
*
* @param query the query to prepare
* @return the prepared statement of the query
* @throws com.badlogic.gdx.sqlite.SQLiteGdxRuntimeException
*/
public com.badlogic.gdx.sqlite.PreparedStatement getPreparedStatement(String query) throws com.badlogic.gdx.sqlite.SQLiteGdxException;

public void beginTransaction() throws com.badlogic.gdx.sqlite.SQLiteGdxException;

public void setTransactionSuccessful() throws com.badlogic.gdx.sqlite.SQLiteGdxException;

public void endTransaction() throws com.badlogic.gdx.sqlite.SQLiteGdxException;
Expand All @@ -65,10 +64,10 @@ public interface Database {
* @return the passed {@link com.badlogic.gdx.sqlite.DatabaseCursor}.
* @throws com.badlogic.gdx.sqlite.SQLiteGdxException */
public com.badlogic.gdx.sqlite.DatabaseCursor rawQuery (com.badlogic.gdx.sqlite.DatabaseCursor cursor, String sql) throws com.badlogic.gdx.sqlite.SQLiteGdxException;

/**
* Return the last insert query generated id.
*
*
* @return the last generated id
*/
public long getLastRowId() throws com.badlogic.gdx.sqlite.SQLiteGdxException;
Expand Down
3 changes: 1 addition & 2 deletions gdx-sqlite/src/com/badlogic/gdx/sqlite/DatabaseCursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ public interface DatabaseCursor {
public boolean next ();

/** Returns the numbers of rows in the cursor.
* @return number of rows
* @throws SQLiteGdxException */
* @return number of rows */
public int getCount ();

/** Closes the Cursor, releasing all of its resources and making it completely invalid. */
Expand Down
Loading