Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite classes in kotlin #105

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
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
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ cache:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

before_install:
- echo yes | sdkmanager "build-tools;28.0.3"

android:
components:
# tools required
- tools
# The BuildTools version used by your project
- build-tools-28.0.0
- build-tools-28.0.3
# The SDK version used to compile your projects
- android-22
- android-28
Expand Down
29 changes: 15 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
mavenCentral()
jcenter()
}

dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0"
classpath "com.android.tools.build:gradle:3.6.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

configure(allprojects) { project ->

version = VERSION_NAME
group = GROUP
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
mavenLocal()
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
mavenLocal()
}
}

Expand All @@ -31,8 +31,9 @@ subprojects {

group = 'org.smartregister'

ext.androidToolsBuildGradle = '28.0.0'
ext.androidBuildToolsVersion = '28.0.0'
ext.androidToolsBuildGradleVersion = '3.6.4'
ext.androidBuildToolsVersion = '28.0.3'
ext.coverallsGradlePluginVersion = '2.8.3'
ext.androidMinSdkVersion = 18
ext.androidCompileSdkVersion = 28
ext.androidTargetSdkVersion = 28
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=0.0.21-SNAPSHOT
VERSION_NAME=0.1.0-SNAPSHOT
VERSION_CODE=1
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client Reporting Library
Expand All @@ -11,5 +11,7 @@ POM_SETTING_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_SETTING_LICENCE_DIST=repo
POM_SETTING_DEVELOPER_ID=opensrp
POM_SETTING_DEVELOPER_NAME=OpenSRP Onadev
android.useAndroidX=true
android.enableJetifier=true


4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Mar 26 17:38:02 EAT 2019
#Tue Jul 21 00:53:45 EAT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
45 changes: 25 additions & 20 deletions opensrp-reporting/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,28 @@ buildscript {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:3.1.2"
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath "com.android.tools.build:gradle:${androidToolsBuildGradleVersion}"
classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:${coverallsGradlePluginVersion}"
}
}

apply plugin: 'com.android.library'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

jacoco {
toolVersion = "0.8.0"
}

android {

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

compileSdkVersion androidCompileSdkVersion
buildToolsVersion androidBuildToolsVersion

Expand All @@ -29,7 +37,7 @@ android {
versionCode Integer.parseInt(project.VERSION_CODE)
versionName project.VERSION_NAME
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand Down Expand Up @@ -73,28 +81,20 @@ tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}

allprojects {
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
mavenLocal()
}
}

dependencies {
implementation('org.smartregister:opensrp-client-core:1.9.3-SNAPSHOT@aar') {
implementation('org.smartregister:opensrp-client-core:1.10.5-SNAPSHOT@aar') {
transitive = true
exclude group: 'com.github.bmelnychuk', module: 'atv'
exclude group: 'com.google.guava', module: 'guava'
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'org.apache.httpcomponents', module: 'httpmime'
}

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.github.lecho:hellocharts-library:1.5.8@aar'

implementation 'com.google.guava:guava:20.0'
Expand All @@ -113,10 +113,12 @@ dependencies {
testImplementation "org.powermock:powermock-api-mockito2:$powerMockVersion"
testImplementation "org.powermock:powermock-classloading-xstream:$powerMockVersion"
testImplementation 'org.skyscreamer:jsonassert:1.5.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

implementation group: 'org.yaml', name: 'snakeyaml', version: '1.23'
implementation "androidx.core:core-ktx:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

}

Expand Down Expand Up @@ -146,3 +148,6 @@ coveralls {
}

apply from: '../maven.gradle'
repositories {
mavenCentral()
}
2 changes: 1 addition & 1 deletion opensrp-reporting/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:label="@string/app_name"
android:supportsRtl="true">
<service
android:name=".service.IndicatorGeneratorIntentService"
android:name="org.smartregister.reporting.service.IndicatorGeneratorIntentService"
android:exported="false"></service>
</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.smartregister.reporting;

import android.support.annotation.NonNull;
import android.util.Log;
import androidx.annotation.NonNull;

import net.sqlcipher.database.SQLiteDatabase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import android.content.Context;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import android.support.v4.widget.TextViewCompat;
import android.support.v7.widget.RecyclerView;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.core.widget.TextViewCompat;
import androidx.recyclerview.widget.RecyclerView;

import org.smartregister.reporting.R;
import org.smartregister.reporting.view.TableView;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package org.smartregister.reporting.dao;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;

import com.google.gson.Gson;

import net.sqlcipher.Cursor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.smartregister.reporting.domain;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.Date;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.smartregister.reporting.domain;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

import java.util.List;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.smartregister.reporting.domain

class IndicatorsYamlConfig {
var indicators: List<IndicatorYamlConfigItem>? = null

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.smartregister.reporting.event;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import org.smartregister.reporting.domain.TallyStatus;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.smartregister.reporting.exception;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import org.smartregister.reporting.domain.CompositeIndicatorTally;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package org.smartregister.reporting.job;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.evernote.android.job.Job;
import com.evernote.android.job.JobCreator;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package org.smartregister.reporting.job;

import android.content.Intent;
import android.support.annotation.NonNull;
import android.util.Log;

import androidx.annotation.NonNull;

import org.smartregister.AllConstants;
import org.smartregister.job.BaseJob;
import org.smartregister.reporting.service.IndicatorGeneratorIntentService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.smartregister.reporting.processor;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.smartregister.reporting.processor;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

import org.smartregister.reporting.domain.CompositeIndicatorTally;
import org.smartregister.reporting.domain.IndicatorTally;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import android.content.ContentValues;
import android.database.SQLException;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.smartregister.reporting.repository;

import android.content.ContentValues;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

Expand Down

This file was deleted.

Loading