Skip to content

Commit

Permalink
Upgrading sdk compile and target versions
Browse files Browse the repository at this point in the history
Dropped and support libs to AndroidX
Added Kotlin support
  • Loading branch information
ocfmem committed Feb 3, 2020
1 parent e93891f commit 117007b
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 51 deletions.
43 changes: 19 additions & 24 deletions android/keyple-plugin/android-omapi/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
apply from: "../../build.gradle"

def version = "0.9.0"

if(project.getProperties().containsKey("release") && release=="true"){
Expand All @@ -8,27 +10,23 @@ if(project.getProperties().containsKey("release") && release=="true"){

apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'

archivesBaseName = "keyple-android-plugin-omapi"

group 'org.eclipse.keyple'
project.description = 'Keyple Plugin Android OMAPI'

pmd {
ruleSets = [
"java-basic",
"java-braces",
]
}

android {
compileSdkVersion 26
buildToolsVersion '26.0.3'
compileSdkVersion 29
buildToolsVersion "29.0.2"

defaultConfig {
minSdkVersion 19
targetSdkVersion 21
targetSdkVersion 29
versionName project.version
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -38,8 +36,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

testOptions {
Expand Down Expand Up @@ -217,24 +215,21 @@ task installPlugin{
}

dependencies {
implementation fileTree(include: ['*.jar'], exclude: ['org.simalliance.openmobileapi.jar'], dir: 'libs')
def kotlin_version = '1.3.31'

//simalliance omapi definition
compileOnly files('libs/org.simalliance.openmobileapi.jar')

//Kotlin
implementation 'androidx.core:core-ktx:1.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

//keyple-core project
implementation group: 'org.eclipse.keyple', name: 'keyple-java-core', version: project.version

//android
implementation "com.android.support:support-v4:${android_support_version}"
implementation "com.android.support:appcompat-v7:${android_support_version}"

//logging
implementation "org.slf4j:slf4j-api:${slf4japi_version}"

//omapi definition
compileOnly files('libs/org.simalliance.openmobileapi.jar')
/*
Tests
*
/** Test **/
testImplementation files('libs/org.simalliance.openmobileapi.jar')

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ buildscript {

dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.14.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
}
}

Expand Down
25 changes: 12 additions & 13 deletions java/example/calypso/android/omapi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,24 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
}
}

apply plugin: 'com.android.application'

project.group 'org.eclipse.keyple'


android {
compileSdkVersion 26
buildToolsVersion '26.0.3'
compileSdkVersion 29
defaultConfig {
applicationId "org.eclipse.keyple.example.calyspo.android.omapi"
minSdkVersion 19
targetSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand Down Expand Up @@ -69,7 +68,8 @@ dependencies {
implementation group: 'org.eclipse.keyple', name: 'keyple-java-calypso', version: '+'

//import the last version of keyple-java-plugin-omapi
implementation group: 'org.eclipse.keyple', name: 'keyple-android-plugin-omapi', version: '+'
//implementation group: 'org.eclipse.keyple', name: 'keyple-android-plugin-omapi', version: '+'
implementation project(':android-omapi')

/*
OMAPI dependencies
Expand All @@ -79,10 +79,9 @@ dependencies {
/*
Android components
*/
implementation "com.android.support:support-v4:${android_support_version}"
implementation "com.android.support:appcompat-v7:${android_support_version}"
implementation "com.android.support:design:${android_support_version}"
implementation "com.android.support.constraint:constraint-layout:${android_support_constraint_version}"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'


/*
Expand All @@ -97,7 +96,7 @@ dependencies {
Test
*/
testImplementation "junit:junit:${junit_version}"
androidTestImplementation "com.android.support.test:runner:${android_support_test}"
androidTestImplementation "com.android.support.test.espresso:espresso-core:${android_support_espresso}"
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

}
4 changes: 3 additions & 1 deletion java/example/calypso/android/omapi/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ android_support_espresso = 3.0.1

#test android
mockito_android_version = 2.7.21
powermock_version = 1.6.6
powermock_version = 1.6.6
android.useAndroidX=true
android.enableJetifier=true
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
package org.eclipse.keyple.example.calypso.android.omapi;

import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import com.google.android.material.navigation.NavigationView;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.util.Log;
import android.view.MenuItem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.eclipse.keyple.plugin.android.omapi.AndroidOmapiPluginFactory;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
Expand All @@ -14,7 +14,7 @@
android:orientation="vertical">


<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
Expand All @@ -30,7 +30,7 @@


<!-- Container for contents of drawer - use NavigationView to make configuration easier -->
<android.support.design.widget.NavigationView
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
Expand All @@ -40,7 +40,7 @@
app:headerLayout="@layout/nav_drawer_header"
/>

</android.support.v4.widget.DrawerLayout>
</androidx.drawerlayout.widget.DrawerLayout>



Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">

Expand Down Expand Up @@ -29,4 +29,4 @@



</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 117007b

Please sign in to comment.