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

com.greensopinion.gradle-android-eclipse JARs #212

Open
relan opened this issue Oct 12, 2020 · 3 comments
Open

com.greensopinion.gradle-android-eclipse JARs #212

relan opened this issue Oct 12, 2020 · 3 comments

Comments

@relan
Copy link

relan commented Oct 12, 2020

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.

eighthave pushed a commit to f-droid/fdroiddata that referenced this issue Oct 12, 2020
@tobykurien
Copy link
Owner

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?

@relan
Copy link
Author

relan commented Oct 14, 2020

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

@tobykurien
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants