From b85edd7fe3fabad0c7405248216a13e3f146d5f2 Mon Sep 17 00:00:00 2001 From: benRivello Date: Mon, 12 Aug 2019 14:18:55 -0400 Subject: [PATCH 01/17] fixed issue 202, set color filter on null object --- .../src/main/java/com/filestack/android/FsActivity.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/filestack/src/main/java/com/filestack/android/FsActivity.java b/filestack/src/main/java/com/filestack/android/FsActivity.java index 206adf66..543f4231 100644 --- a/filestack/src/main/java/com/filestack/android/FsActivity.java +++ b/filestack/src/main/java/com/filestack/android/FsActivity.java @@ -266,8 +266,9 @@ public boolean onCreateOptionsMenu(Menu menu) { menu.findItem(R.id.action_about).setVisible(showVersionInfo); for (int i = 0; i < menu.size(); i++) { MenuItem item = menu.getItem(i); - Drawable drawable = DrawableCompat.wrap(item.getIcon()); - if (drawable != null) { + Drawable icon = item.getIcon(); + Drawable drawable = DrawableCompat.wrap(icon); + if (icon != null && drawable != null) { drawable.setColorFilter(theme.getBackgroundColor(), PorterDuff.Mode.SRC_ATOP); DrawableCompat.setTint(drawable, theme.getBackgroundColor()); item.setIcon(drawable); From 709d0181241a83d1885599e08da1d442b01980b0 Mon Sep 17 00:00:00 2001 From: benRivello Date: Mon, 12 Aug 2019 14:22:07 -0400 Subject: [PATCH 02/17] fixed lollypop(5.0.1) camera video upload https://www.e-learn.cn/en/node/2205560 --- .../java/com/filestack/android/internal/Util.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/filestack/src/main/java/com/filestack/android/internal/Util.java b/filestack/src/main/java/com/filestack/android/internal/Util.java index 2486e168..9f7bfa7a 100644 --- a/filestack/src/main/java/com/filestack/android/internal/Util.java +++ b/filestack/src/main/java/com/filestack/android/internal/Util.java @@ -3,6 +3,7 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; +import android.os.Build; import android.os.Environment; import android.support.v4.content.FileProvider; import android.support.v4.content.MimeTypeFilter; @@ -188,8 +189,14 @@ public static File createMovieFile(Context context) throws IOException { // If we don't do this, we'll get the exception when sending the URI to the camera app // See the FileProvider example in https://developer.android.com/training/camera/photobasics public static Uri getUriForInternalMedia(Context context, File file) { - String authority = context.getPackageName() + ".fileprovider"; - return FileProvider.getUriForFile(context, authority, file); + Uri uri; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + String authority = context.getPackageName() + ".fileprovider"; + uri = FileProvider.getUriForFile(context, authority, file); + } else { + uri = Uri.fromFile(file); + } + return uri; } // TODO This doesn't seem to work From bda884b4e783813b10bed5294268fde499304b41 Mon Sep 17 00:00:00 2001 From: benRivello Date: Thu, 5 Mar 2020 10:06:34 -0500 Subject: [PATCH 03/17] attempt to fux null pointer --- .../java/com/filestack/android/internal/CloudListAdapter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filestack/src/main/java/com/filestack/android/internal/CloudListAdapter.java b/filestack/src/main/java/com/filestack/android/internal/CloudListAdapter.java index b75481c0..9999929b 100644 --- a/filestack/src/main/java/com/filestack/android/internal/CloudListAdapter.java +++ b/filestack/src/main/java/com/filestack/android/internal/CloudListAdapter.java @@ -76,7 +76,8 @@ class CloudListAdapter extends RecyclerView.Adapter impleme currentPath = saveInstanceState.getString(STATE_CURRENT_PATH); folders = (HashMap) saveInstanceState.getSerializable(STATE_FOLDERS); nextTokens = (HashMap) saveInstanceState.getSerializable(STATE_NEXT_TOKENS); - } else { + } + if (currentPath == null || folders == null || nextTokens == null){ folders = new HashMap<>(); nextTokens = new HashMap<>(); setPath("/"); From fcb1d27daf9e0a7b123cd40d22d28062c7b55921 Mon Sep 17 00:00:00 2001 From: benRivello Date: Thu, 5 Mar 2020 10:43:12 -0500 Subject: [PATCH 04/17] fixed null pointer fix --- .../com/filestack/android/internal/CloudListAdapter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/filestack/src/main/java/com/filestack/android/internal/CloudListAdapter.java b/filestack/src/main/java/com/filestack/android/internal/CloudListAdapter.java index 9999929b..a79b03e6 100644 --- a/filestack/src/main/java/com/filestack/android/internal/CloudListAdapter.java +++ b/filestack/src/main/java/com/filestack/android/internal/CloudListAdapter.java @@ -76,8 +76,10 @@ class CloudListAdapter extends RecyclerView.Adapter impleme currentPath = saveInstanceState.getString(STATE_CURRENT_PATH); folders = (HashMap) saveInstanceState.getSerializable(STATE_FOLDERS); nextTokens = (HashMap) saveInstanceState.getSerializable(STATE_NEXT_TOKENS); - } - if (currentPath == null || folders == null || nextTokens == null){ + if (folders == null || folders.get(currentPath) == null) { + folders.put(currentPath, new ArrayList()); + } + } else { folders = new HashMap<>(); nextTokens = new HashMap<>(); setPath("/"); From d42756fefe05d36d6985ad6b6c7015d7059be45e Mon Sep 17 00:00:00 2001 From: benRivello Date: Fri, 28 Aug 2020 16:36:38 -0400 Subject: [PATCH 05/17] added safty checkoing for Util.getClient().getSessionToken() null pointer exception in FsActivity --- .../src/main/java/com/filestack/android/FsActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/filestack/src/main/java/com/filestack/android/FsActivity.java b/filestack/src/main/java/com/filestack/android/FsActivity.java index 543f4231..4399df7f 100644 --- a/filestack/src/main/java/com/filestack/android/FsActivity.java +++ b/filestack/src/main/java/com/filestack/android/FsActivity.java @@ -208,8 +208,11 @@ protected void onStop() { super.onStop(); SharedPreferences preferences = getPreferences(MODE_PRIVATE); - String sessionToken = Util.getClient().getSessionToken(); - preferences.edit().putString(PREF_SESSION_TOKEN, sessionToken).apply(); + if (Util.getClient() != null) { + String sessionToken = Util.getClient().getSessionToken(); + preferences.edit().putString(PREF_SESSION_TOKEN, sessionToken).apply(); + } + Util.getSelectionSaver().setItemChangeListener(null); } From a59c81ee7d4ed9c8faf5afe174463adef66e525e Mon Sep 17 00:00:00 2001 From: benRivello Date: Thu, 24 Sep 2020 15:14:22 -0400 Subject: [PATCH 06/17] enabled custom filename setting --- .../main/java/com/filestack/android/internal/UploadService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filestack/src/main/java/com/filestack/android/internal/UploadService.java b/filestack/src/main/java/com/filestack/android/internal/UploadService.java index 27c70197..493471da 100644 --- a/filestack/src/main/java/com/filestack/android/internal/UploadService.java +++ b/filestack/src/main/java/com/filestack/android/internal/UploadService.java @@ -127,7 +127,7 @@ private FileLink upload(Selection selection, StorageOptions baseOptions) { String mimeType = selection.getMimeType(); StorageOptions options = baseOptions.newBuilder() - .filename(name) + .filename(baseOptions.getFilename() == null ? baseOptions.getFilename(): name) .mimeType(mimeType) .build(); From d914f14b3a263feff3d86c73f4bf57173696b85d Mon Sep 17 00:00:00 2001 From: benRivello Date: Wed, 30 Sep 2020 11:02:02 -0400 Subject: [PATCH 07/17] combined filenames --- .../main/java/com/filestack/android/internal/UploadService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filestack/src/main/java/com/filestack/android/internal/UploadService.java b/filestack/src/main/java/com/filestack/android/internal/UploadService.java index 493471da..513262b1 100644 --- a/filestack/src/main/java/com/filestack/android/internal/UploadService.java +++ b/filestack/src/main/java/com/filestack/android/internal/UploadService.java @@ -127,7 +127,7 @@ private FileLink upload(Selection selection, StorageOptions baseOptions) { String mimeType = selection.getMimeType(); StorageOptions options = baseOptions.newBuilder() - .filename(baseOptions.getFilename() == null ? baseOptions.getFilename(): name) + .filename(baseOptions.getFilename() + name) .mimeType(mimeType) .build(); From 54a285850d75aa8b49876936bda5de6c34a16f30 Mon Sep 17 00:00:00 2001 From: Ryan Kuhn Date: Mon, 5 Apr 2021 11:20:00 -0400 Subject: [PATCH 08/17] test fix --- .../filestack__activity_filestack.xml | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 filestack/src/main/res/layout-sw600dp/filestack__activity_filestack.xml diff --git a/filestack/src/main/res/layout-sw600dp/filestack__activity_filestack.xml b/filestack/src/main/res/layout-sw600dp/filestack__activity_filestack.xml deleted file mode 100644 index 28a16a6b..00000000 --- a/filestack/src/main/res/layout-sw600dp/filestack__activity_filestack.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - From a73607c3da14f00d81a3c28a782666720e022c79 Mon Sep 17 00:00:00 2001 From: Ryan Kuhn Date: Wed, 16 Feb 2022 13:09:37 -0500 Subject: [PATCH 09/17] update android target --- build.gradle | 4 +++- filestack/build.gradle | 6 +++--- filestack/src/main/AndroidManifest.xml | 1 + gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 3200257b..ab88d78a 100644 --- a/build.gradle +++ b/build.gradle @@ -3,11 +3,12 @@ buildscript { ext.kotlin_version = '1.2.71' repositories { + mavenCentral() jcenter() google() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:4.2.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong @@ -17,6 +18,7 @@ buildscript { allprojects { repositories { + jcenter() mavenLocal() jcenter() google() diff --git a/filestack/build.gradle b/filestack/build.gradle index 09b419d4..99dc7e55 100644 --- a/filestack/build.gradle +++ b/filestack/build.gradle @@ -11,13 +11,13 @@ version = '5.3.0' project.archivesBaseName = 'filestack-android' android { - compileSdkVersion 28 + compileSdkVersion 31 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 versionCode 1 versionName version + minSdkVersion 21 + targetSdkVersion 31 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/filestack/src/main/AndroidManifest.xml b/filestack/src/main/AndroidManifest.xml index 1bb5843f..fca6b789 100644 --- a/filestack/src/main/AndroidManifest.xml +++ b/filestack/src/main/AndroidManifest.xml @@ -13,6 +13,7 @@ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e362f97d..d931f4d4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip From d4c154fc6df57b27472f04f6548babed1bf95dfb Mon Sep 17 00:00:00 2001 From: Ryan Kuhn Date: Wed, 16 Feb 2022 14:00:12 -0500 Subject: [PATCH 10/17] update build config --- build.gradle | 8 ++------ filestack/build.gradle | 20 +++++++++++--------- gradle.properties | 1 + samples/form/app/build.gradle | 4 ++-- tester/build.gradle | 4 ++-- tester/src/main/AndroidManifest.xml | 3 ++- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index ab88d78a..b16e9105 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,5 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { - ext.kotlin_version = '1.2.71' + ext.kotlin_version = '1.6.0' repositories { mavenCentral() jcenter() @@ -10,9 +8,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:4.2.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' } } diff --git a/filestack/build.gradle b/filestack/build.gradle index 99dc7e55..4a5dc91e 100644 --- a/filestack/build.gradle +++ b/filestack/build.gradle @@ -1,13 +1,13 @@ plugins { - id 'com.github.dcendents.android-maven' version '2.0' id 'com.jfrog.bintray' version '1.7.3' } apply plugin: 'com.android.library' apply plugin: 'kotlin-android' +apply plugin: 'com.github.dcendents.android-maven' -group = 'com.filestack' -version = '5.3.0' +group='com.github.teamsuitable' +version = '1.0.9-beta' project.archivesBaseName = 'filestack-android' android { @@ -43,7 +43,9 @@ dependencies { implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:customtabs:28.0.0' - + implementation 'com.squareup.okhttp3:okhttp:4.9.1' + implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0' + implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' @@ -67,11 +69,11 @@ task javadoc(type: Javadoc) { } // Add dependencies to javadoc classpath so annotations work -afterEvaluate { - javadoc.classpath += files(android.libraryVariants.collect { variant -> - variant.javaCompiler.classpath.files - }) -} +//afterEvaluate { +// javadoc.classpath += files(android.libraryVariants.collect { variant -> +// variant.getJavaCompilerProvider().classpath.files +// }) +//} task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' diff --git a/gradle.properties b/gradle.properties index aac7c9b4..82695ffd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,6 +10,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx1536m +android.debug.obsoleteApi=true # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit diff --git a/samples/form/app/build.gradle b/samples/form/app/build.gradle index 5ea2d585..e279ae3c 100644 --- a/samples/form/app/build.gradle +++ b/samples/form/app/build.gradle @@ -4,8 +4,8 @@ android { compileSdkVersion 27 defaultConfig { applicationId "com.filestack.android.samples.form" - minSdkVersion 19 - targetSdkVersion 27 + minSdkVersion 21 + targetSdkVersion 31 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/tester/build.gradle b/tester/build.gradle index 51c44fd4..75307ef3 100644 --- a/tester/build.gradle +++ b/tester/build.gradle @@ -5,8 +5,8 @@ android { defaultConfig { applicationId "com.filestack.android.demo" - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 31 versionCode 1 versionName "1.0" diff --git a/tester/src/main/AndroidManifest.xml b/tester/src/main/AndroidManifest.xml index ce41a559..812477ab 100644 --- a/tester/src/main/AndroidManifest.xml +++ b/tester/src/main/AndroidManifest.xml @@ -10,7 +10,8 @@ android:theme="@style/AppTheme"> + android:name=".MainActivity" + android:exported="true"> From d5ea18b6f084006fccdb6b2bb7fcafcb0627c43f Mon Sep 17 00:00:00 2001 From: Ryan Kuhn Date: Wed, 16 Feb 2022 14:53:28 -0500 Subject: [PATCH 11/17] fix publishing possibly --- filestack/build.gradle | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/filestack/build.gradle b/filestack/build.gradle index 4a5dc91e..e926d5dd 100644 --- a/filestack/build.gradle +++ b/filestack/build.gradle @@ -4,6 +4,7 @@ plugins { apply plugin: 'com.android.library' apply plugin: 'kotlin-android' +apply plugin: 'maven-publish' apply plugin: 'com.github.dcendents.android-maven' group='com.github.teamsuitable' @@ -75,6 +76,32 @@ task javadoc(type: Javadoc) { // }) //} +afterEvaluate { + publishing { + publications { + // Creates a Maven publication called "release". + release(MavenPublication) { + // Applies the component for the release build variant. + from components.release + + // You can then customize attributes of the publication as shown below. + groupId = 'com.github.teamsuitable' + artifactId = 'final' + version = '1.0.9-beta.1' + } + // Creates a Maven publication called “debug”. + debug(MavenPublication) { + // Applies the component for the debug build variant. + from components.debug + + groupId = 'com.github.teamsuitable' + artifactId = 'final-debug' + version = '1.0.9-beta.1' + } + } + } +} + task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir From ad4d66f798b4caa9262f923b4444555d12b45604 Mon Sep 17 00:00:00 2001 From: Ryan Kuhn Date: Wed, 16 Feb 2022 15:25:40 -0500 Subject: [PATCH 12/17] test publishing fix --- filestack/build.gradle | 82 +++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 36 deletions(-) diff --git a/filestack/build.gradle b/filestack/build.gradle index e926d5dd..51c2b312 100644 --- a/filestack/build.gradle +++ b/filestack/build.gradle @@ -2,6 +2,7 @@ plugins { id 'com.jfrog.bintray' version '1.7.3' } +//apply from: file('publish.gradle') apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'maven-publish' @@ -57,17 +58,12 @@ dependencies { testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -task javadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - options.addStringOption('Xdoclint:none', '-quiet') - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - destinationDir = file("../docs/") -} +//task javadoc(type: Javadoc) { +// source = android.sourceSets.main.java.srcDirs +// options.addStringOption('Xdoclint:none', '-quiet') +// classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +// destinationDir = file("../docs/") +//} // Add dependencies to javadoc classpath so annotations work //afterEvaluate { @@ -76,40 +72,54 @@ task javadoc(type: Javadoc) { // }) //} -afterEvaluate { - publishing { - publications { - // Creates a Maven publication called "release". - release(MavenPublication) { - // Applies the component for the release build variant. - from components.release - - // You can then customize attributes of the publication as shown below. - groupId = 'com.github.teamsuitable' - artifactId = 'final' - version = '1.0.9-beta.1' - } - // Creates a Maven publication called “debug”. - debug(MavenPublication) { - // Applies the component for the debug build variant. - from components.debug - - groupId = 'com.github.teamsuitable' - artifactId = 'final-debug' - version = '1.0.9-beta.1' - } - } - } +//afterEvaluate { +// publishing { +// publications { +// // Creates a Maven publication called "release". +// release(MavenPublication) { +// // Applies the component for the release build variant. +// from components.release +// +// // You can then customize attributes of the publication as shown below. +// groupId = 'com.github.teamsuitable' +// artifactId = 'final' +// version = '1.0.9-beta.1' +// } +// // Creates a Maven publication called “debug”. +// debug(MavenPublication) { +// // Applies the component for the debug build variant. +// from components.debug +// +// groupId = 'com.github.teamsuitable' +// artifactId = 'final-debug' +// version = '1.0.9-beta.1' +// } +// } +// } +//} + +// Build a jar with source files. +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' } +task javadoc(type: Javadoc) { + failOnError false + source = android.sourceSets.main.java.sourceFiles + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + classpath += configurations.compile +} + +// Build a jar with javadoc. task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir } artifacts { - archives javadocJar archives sourcesJar + archives javadocJar } bintray { From c9a54e1a71285bbc3351be58ca48478aebf3ad8e Mon Sep 17 00:00:00 2001 From: Ryan Kuhn Date: Wed, 16 Feb 2022 16:02:10 -0500 Subject: [PATCH 13/17] possible publishing fix pt 2 --- filestack/build.gradle | 110 ++++++++++++++++++--------------------- filestack/publish.gradle | 45 ++++++++++++++++ 2 files changed, 96 insertions(+), 59 deletions(-) create mode 100644 filestack/publish.gradle diff --git a/filestack/build.gradle b/filestack/build.gradle index 51c2b312..216dc896 100644 --- a/filestack/build.gradle +++ b/filestack/build.gradle @@ -2,10 +2,9 @@ plugins { id 'com.jfrog.bintray' version '1.7.3' } -//apply from: file('publish.gradle') -apply plugin: 'com.android.library' +apply from: file('publish.gradle') apply plugin: 'kotlin-android' -apply plugin: 'maven-publish' +//apply plugin: 'maven-publish' apply plugin: 'com.github.dcendents.android-maven' group='com.github.teamsuitable' @@ -58,9 +57,16 @@ dependencies { testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } +//task sourcesJar(type: Jar) { +// from android.sourceSets.main.java.srcDirs +// classifier = 'sources' +//} +// //task javadoc(type: Javadoc) { // source = android.sourceSets.main.java.srcDirs // options.addStringOption('Xdoclint:none', '-quiet') +// options.addStringOption('encoding', 'UTF-8') +// options.addStringOption('charSet', 'UTF-8') // classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) // destinationDir = file("../docs/") //} @@ -82,7 +88,7 @@ dependencies { // // // You can then customize attributes of the publication as shown below. // groupId = 'com.github.teamsuitable' -// artifactId = 'final' +// artifactId = 'filestack-android' // version = '1.0.9-beta.1' // } // // Creates a Maven publication called “debug”. @@ -91,64 +97,50 @@ dependencies { // from components.debug // // groupId = 'com.github.teamsuitable' -// artifactId = 'final-debug' +// artifactId = 'filestack-android' // version = '1.0.9-beta.1' // } // } // } //} +// +//task javadocJar(type: Jar, dependsOn: javadoc) { +// classifier = 'javadoc' +// from javadoc.destinationDir +//} +// +//artifacts { +// archives javadocJar +// archives sourcesJar +//} -// Build a jar with source files. -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -task javadoc(type: Javadoc) { - failOnError false - source = android.sourceSets.main.java.sourceFiles - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - classpath += configurations.compile -} - -// Build a jar with javadoc. -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -artifacts { - archives sourcesJar - archives javadocJar -} - -bintray { - user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') - : System.getenv('BINTRAY_USER') - key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') - : System.getenv('BINTRAY_API_KEY') - configurations = ['archives'] - publish = true - pkg { - repo = 'maven' - userOrg = 'filestack' - name = 'filestack-android' - desc = 'Official Android SDK for Filestack.' - - publicDownloadNumbers = true - licenses = ['Apache-2.0'] - - websiteUrl = 'https://filestack.com' - vcsUrl = 'https://github.com/filestack/filestack-android.git' - issueTrackerUrl = 'https://github.com/filestack/filestack-android/issues' - - githubRepo = 'filestack/filestack-android' - githubReleaseNotesFile = 'CHANGELOG.md' - - version { - name = project.version - vcsTag = project.version - released = new Date() - } - } -} +//bintray { +// user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') +// : System.getenv('BINTRAY_USER') +// key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') +// : System.getenv('BINTRAY_API_KEY') +// configurations = ['archives'] +// publish = true +// pkg { +// repo = 'maven' +// userOrg = 'filestack' +// name = 'filestack-android' +// desc = 'Official Android SDK for Filestack.' +// +// publicDownloadNumbers = true +// licenses = ['Apache-2.0'] +// +// websiteUrl = 'https://filestack.com' +// vcsUrl = 'https://github.com/filestack/filestack-android.git' +// issueTrackerUrl = 'https://github.com/filestack/filestack-android/issues' +// +// githubRepo = 'filestack/filestack-android' +// githubReleaseNotesFile = 'CHANGELOG.md' +// +// version { +// name = project.version +// vcsTag = project.version +// released = new Date() +// } +// } +//} diff --git a/filestack/publish.gradle b/filestack/publish.gradle new file mode 100644 index 00000000..09ed1670 --- /dev/null +++ b/filestack/publish.gradle @@ -0,0 +1,45 @@ +apply plugin: 'maven-publish' +apply plugin: 'com.android.library' + +def LIB_GROUP_ID = 'com.github.teamsuitable' +def LIB_ARTIFACT_ID = 'filestack-android' +def LIB_VERSION = '1.0.9-beta.1' + +task sourceJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier "sources" +} + +publishing { + repositories { + maven { + name = "GithubPackages" + url = uri("https://maven.pkg.github.com/teamsuitable/AndroidLibForArtifactory") + } + maven { + name = 'CustomMavenRepo' + url = "file://${buildDir}/repo" + } + } + publications { + droidlib2(MavenPublication) { + groupId LIB_GROUP_ID + artifactId LIB_ARTIFACT_ID + version LIB_VERSION + artifact("$buildDir/outputs/aar/filestack-android-release.aar") + artifact(sourceJar) + + pom.withXml { + def dependenciesNode = asNode().appendNode('dependencies') + + //Iterate over the compile dependencies (we don't want the test ones), adding a node for each + configurations.api.allDependencies.each { + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', it.group) + dependencyNode.appendNode('artifactId', it.name) + dependencyNode.appendNode('version', it.version) + } + } + } + } +} \ No newline at end of file From 77c3c4424b562381ab38ad0b323af329da40b16d Mon Sep 17 00:00:00 2001 From: Ryan Kuhn Date: Wed, 16 Feb 2022 16:41:00 -0500 Subject: [PATCH 14/17] revert manual publication in favor of jitpack building --- filestack/build.gradle | 131 +++++++++++++++------------------------ filestack/publish.gradle | 45 -------------- 2 files changed, 51 insertions(+), 125 deletions(-) delete mode 100644 filestack/publish.gradle diff --git a/filestack/build.gradle b/filestack/build.gradle index 216dc896..ae92bbe5 100644 --- a/filestack/build.gradle +++ b/filestack/build.gradle @@ -2,9 +2,8 @@ plugins { id 'com.jfrog.bintray' version '1.7.3' } -apply from: file('publish.gradle') +apply plugin: 'com.android.library' apply plugin: 'kotlin-android' -//apply plugin: 'maven-publish' apply plugin: 'com.github.dcendents.android-maven' group='com.github.teamsuitable' @@ -57,19 +56,17 @@ dependencies { testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } -//task sourcesJar(type: Jar) { -// from android.sourceSets.main.java.srcDirs -// classifier = 'sources' -//} -// -//task javadoc(type: Javadoc) { -// source = android.sourceSets.main.java.srcDirs -// options.addStringOption('Xdoclint:none', '-quiet') -// options.addStringOption('encoding', 'UTF-8') -// options.addStringOption('charSet', 'UTF-8') -// classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) -// destinationDir = file("../docs/") -//} +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + options.addStringOption('Xdoclint:none', '-quiet') + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + destinationDir = file("../docs/") +} // Add dependencies to javadoc classpath so annotations work //afterEvaluate { @@ -78,69 +75,43 @@ dependencies { // }) //} -//afterEvaluate { -// publishing { -// publications { -// // Creates a Maven publication called "release". -// release(MavenPublication) { -// // Applies the component for the release build variant. -// from components.release -// -// // You can then customize attributes of the publication as shown below. -// groupId = 'com.github.teamsuitable' -// artifactId = 'filestack-android' -// version = '1.0.9-beta.1' -// } -// // Creates a Maven publication called “debug”. -// debug(MavenPublication) { -// // Applies the component for the debug build variant. -// from components.debug -// -// groupId = 'com.github.teamsuitable' -// artifactId = 'filestack-android' -// version = '1.0.9-beta.1' -// } -// } -// } -//} -// -//task javadocJar(type: Jar, dependsOn: javadoc) { -// classifier = 'javadoc' -// from javadoc.destinationDir -//} -// -//artifacts { -// archives javadocJar -// archives sourcesJar -//} +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} -//bintray { -// user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') -// : System.getenv('BINTRAY_USER') -// key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') -// : System.getenv('BINTRAY_API_KEY') -// configurations = ['archives'] -// publish = true -// pkg { -// repo = 'maven' -// userOrg = 'filestack' -// name = 'filestack-android' -// desc = 'Official Android SDK for Filestack.' -// -// publicDownloadNumbers = true -// licenses = ['Apache-2.0'] -// -// websiteUrl = 'https://filestack.com' -// vcsUrl = 'https://github.com/filestack/filestack-android.git' -// issueTrackerUrl = 'https://github.com/filestack/filestack-android/issues' -// -// githubRepo = 'filestack/filestack-android' -// githubReleaseNotesFile = 'CHANGELOG.md' -// -// version { -// name = project.version -// vcsTag = project.version -// released = new Date() -// } -// } -//} +artifacts { + archives javadocJar + archives sourcesJar +} + +bintray { + user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') + : System.getenv('BINTRAY_USER') + key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') + : System.getenv('BINTRAY_API_KEY') + configurations = ['archives'] + publish = true + pkg { + repo = 'maven' + userOrg = 'filestack' + name = 'filestack-android' + desc = 'Official Android SDK for Filestack.' + + publicDownloadNumbers = true + licenses = ['Apache-2.0'] + + websiteUrl = 'https://filestack.com' + vcsUrl = 'https://github.com/filestack/filestack-android.git' + issueTrackerUrl = 'https://github.com/filestack/filestack-android/issues' + + githubRepo = 'filestack/filestack-android' + githubReleaseNotesFile = 'CHANGELOG.md' + + version { + name = project.version + vcsTag = project.version + released = new Date() + } + } +} \ No newline at end of file diff --git a/filestack/publish.gradle b/filestack/publish.gradle deleted file mode 100644 index 09ed1670..00000000 --- a/filestack/publish.gradle +++ /dev/null @@ -1,45 +0,0 @@ -apply plugin: 'maven-publish' -apply plugin: 'com.android.library' - -def LIB_GROUP_ID = 'com.github.teamsuitable' -def LIB_ARTIFACT_ID = 'filestack-android' -def LIB_VERSION = '1.0.9-beta.1' - -task sourceJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier "sources" -} - -publishing { - repositories { - maven { - name = "GithubPackages" - url = uri("https://maven.pkg.github.com/teamsuitable/AndroidLibForArtifactory") - } - maven { - name = 'CustomMavenRepo' - url = "file://${buildDir}/repo" - } - } - publications { - droidlib2(MavenPublication) { - groupId LIB_GROUP_ID - artifactId LIB_ARTIFACT_ID - version LIB_VERSION - artifact("$buildDir/outputs/aar/filestack-android-release.aar") - artifact(sourceJar) - - pom.withXml { - def dependenciesNode = asNode().appendNode('dependencies') - - //Iterate over the compile dependencies (we don't want the test ones), adding a node for each - configurations.api.allDependencies.each { - def dependencyNode = dependenciesNode.appendNode('dependency') - dependencyNode.appendNode('groupId', it.group) - dependencyNode.appendNode('artifactId', it.name) - dependencyNode.appendNode('version', it.version) - } - } - } - } -} \ No newline at end of file From 8b4fef87418e4cc76307e6b745d0e1e57894e538 Mon Sep 17 00:00:00 2001 From: Ryan Kuhn Date: Wed, 16 Feb 2022 17:25:54 -0500 Subject: [PATCH 15/17] fix version number --- filestack/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filestack/build.gradle b/filestack/build.gradle index ae92bbe5..aa1987bd 100644 --- a/filestack/build.gradle +++ b/filestack/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'kotlin-android' apply plugin: 'com.github.dcendents.android-maven' group='com.github.teamsuitable' -version = '1.0.9-beta' +version = '1.0.9.1' project.archivesBaseName = 'filestack-android' android { From a940e9dd313286e23c40a2a9167a02dac9f598a5 Mon Sep 17 00:00:00 2001 From: Ryan Kuhn Date: Wed, 16 Feb 2022 17:33:04 -0500 Subject: [PATCH 16/17] attempt package identifier revert --- filestack/build.gradle | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/filestack/build.gradle b/filestack/build.gradle index aa1987bd..0cd5f8d0 100644 --- a/filestack/build.gradle +++ b/filestack/build.gradle @@ -1,23 +1,23 @@ plugins { + id 'com.github.dcendents.android-maven' id 'com.jfrog.bintray' version '1.7.3' } apply plugin: 'com.android.library' apply plugin: 'kotlin-android' -apply plugin: 'com.github.dcendents.android-maven' -group='com.github.teamsuitable' -version = '1.0.9.1' +group = 'com.filestack' +version = '5.3.0' project.archivesBaseName = 'filestack-android' android { compileSdkVersion 31 defaultConfig { - versionCode 1 - versionName version minSdkVersion 21 targetSdkVersion 31 + versionCode 1 + versionName version testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -43,8 +43,6 @@ dependencies { implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:customtabs:28.0.0' - implementation 'com.squareup.okhttp3:okhttp:4.9.1' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0' implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' @@ -69,11 +67,11 @@ task javadoc(type: Javadoc) { } // Add dependencies to javadoc classpath so annotations work -//afterEvaluate { -// javadoc.classpath += files(android.libraryVariants.collect { variant -> -// variant.getJavaCompilerProvider().classpath.files -// }) -//} +afterEvaluate { + javadoc.classpath += files(android.libraryVariants.collect { variant -> + variant.javaCompiler.classpath.files + }) +} task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' From 7513984d97090ec56d5ebc1d51d15e438f115a3d Mon Sep 17 00:00:00 2001 From: Ryan Kuhn Date: Thu, 17 Feb 2022 11:59:39 -0500 Subject: [PATCH 17/17] fix filestack-android build --- build.gradle | 3 ++- filestack/build.gradle | 1 - gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index b16e9105..510736b9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,13 @@ buildscript { ext.kotlin_version = '1.6.0' + ext.buildToolsVersion = "30.0.3" repositories { mavenCentral() jcenter() google() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' + classpath 'com.android.tools.build:gradle:7.0.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' } diff --git a/filestack/build.gradle b/filestack/build.gradle index 0cd5f8d0..b8f45313 100644 --- a/filestack/build.gradle +++ b/filestack/build.gradle @@ -1,5 +1,4 @@ plugins { - id 'com.github.dcendents.android-maven' id 'com.jfrog.bintray' version '1.7.3' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d931f4d4..a72b2e8a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip