WebApps icon indicating copy to clipboard operation
WebApps copied to clipboard

com.greensopinion.gradle-android-eclipse JARs

Open relan opened this issue 5 years ago • 3 comments

F-Droid does not allow JARs in the source code tree: https://f-droid.org/wiki/page/com.tobykurien.webapps/lastbuild_36. They've been disallowed for many years already but we recently started to enforce this policy.

Please remove app/libs and set up the plugin as described in https://plugins.gradle.org/plugin/com.greensopinion.gradle-android-eclipse.

relan avatar Oct 12 '20 07:10 relan

Thanks @relan but I don't understand the issue or the fix. The jars are only included for compiling as part of a gradle plugin for project setup purposes (they are in the buildscript not in the app), so I'm not sure what the issue is. Am I meant to remove the plugin from my buildscript? If so, how am I meant to compile my project with Eclipse on a fresh machine? When you say "set up the the plugin as described in ...", that is how I've installed it, using the legacy mode. Are you suggesting I change to the plugins DSL and it will all be fine?

tobykurien avatar Oct 13 '20 10:10 tobykurien

The jars are only included for compiling as part of a gradle plugin for project setup purposes (they are in the buildscript not in the app), so I'm not sure what the issue is.

From the Inclusion Policy:

Binary dependencies such as JAR files have to be replaced by source-built versions or used from a trusted repository

So there should be no JARs in the source code tree.

When you say "set up the the plugin as described in ...", that is how I've installed it, using the legacy mode.

I meant to delete the JARs and pull the plugin from the official repository:

diff --git a/app/build.gradle b/app/build.gradle
index 92f3994..3179377 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -5,8 +5,8 @@ buildscript {
         maven {
             url "https://maven.google.com"
         }
-        flatDir {
-            dirs "libs"
+        maven {
+            url "https://plugins.gradle.org/m2/"
         }
     }
 

But this didn't work out and I gave up:

java.lang.UnsupportedClassVersionError: com/greensopinion/gradle/android/eclipse/EclipseGeneratorPlugin has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0

relan avatar Oct 14 '20 06:10 relan

@relan yes exactly, the JAR in the repository was built with a newer JDK, but to compile Android you have to use JDK8. The only way around this for me was to compile the jar myself and include it in the project, which is what you see. To satisfy F-droid's requirement, I would have to remove that jar, and set up some method that it gets compiled from source before gradle runs.

However, since the Eclipse plugin is only really needed for a developer as a once-off project setup, I will look into a way to remove it from the regular build and set up a compile step for the JAR.

tobykurien avatar Oct 31 '20 08:10 tobykurien