[Pkg-pascal-devel] Castle Game Engine 6.0 release in Debian
Michalis Kamburelis
michalis.kambi at gmail.com
Tue Mar 21 04:56:08 UTC 2017
2017-03-19 20:32 GMT+01:00 Paul Gevers <elbrus at debian.org>:
> Hi Michalis,
>
> On 03/18/17 10:09, Michalis Kamburelis wrote:
>> So, the Gradle version 3.2.1, available in Debian testing and
>> unstable, cannot be used to build Android tools at all (it's too old
>> for Android plugin 2.1.3-2.2.3, and too new for Android plugin 2.3.0,
>> which is confirmed officially on
>> https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle
>> ).
>
> I don't want to be rude (and you tried and got an error, so you are
> probably right), but that page says for Android 2.1.3-2.2.3: 2.14.1+
> (mind the plus). I would normally expect that to mean: any known newer
> version. Do you read it differently? E.g. any newer version in the 2.*
> series, or even 2.14.* series? In other words, I read it as "it is
> expected to work" so when it doesn't either that is a bug, or that
> web-page could do with an update.
>
I understood "2.14.1+" as "2.14.* series". Not "any version >=
2.14.1". Probably because I saw that the table on
https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle
is otherwise very careful in guaranteeing which version works with
what.
The fact that it failed with Gradle 3.2 confirmed it.
Googling and testing, you're right! That table should be interpreted
as "any version >= 2.14.1". It's just a bug in Android plugin 2.1.3
that it fails with Gradle 3.x... One can upgrade to Android plugin
2.2.x, that will really work with all Gradle >= 2.14.1, including
Gradle 3.2 in the current Debian testing.
So, I too hastily concluded that's "it's not possible". Between
Android plugin 2.1.3 and 2.3.0 is a version 2.2.3 that works for our
purposes:)
Testing more: In order to use Gradle from Debian, note that you cannot
simply copy (or symlink) the /usr/share/java/gradle-wrapper.jar (from
libgradle-plugins-java) to our gradle/wrapper/gradle-wrapper.jar . It
seems that /usr/share/java/gradle-wrapper.jar does not contain all the
necesary classes, and the compilation will then fail with
~~~~
./gradlew assembleDebug
Exception in thread "main" java.lang.NoClassDefFoundError:
org/gradle/cli/CommandLineParser
~~~~
Comparing /usr/share/java/gradle-wrapper.jar with
gradle/wrapper/gradle-wrapper.jar indeed shows that
/usr/share/java/gradle-wrapper.jar does not have various "cli"-related
classes.
I don't know why, but this problem can be avoided cleanly:
1. Simply call "gradle" on $PATH (from the "gradle" package), instead
of using our "./gradlew" wrapper. By a trivial patch, like attached.
2. Our wrapper files can be just deleted in this case ("rm -Rf gradle/
gradlew gradlew.bat", in tools/build-tool/data/android/integrated/ and
in tools/build-tool/data/android/base/ ).
So, you're welcome to do 1. and 2. in the Debian package. Apply also
the patch to upgrade Android Gradle plugin to 2.2.3, like here:
https://github.com/castle-engine/castle-engine/commit/c11b1f4bf19a5ef4ee51624bf6356aaa801b0f8d
. I just tested that everything works fine with this setup, on Debian
testing.
There remains a problem how to communicate this dependency to users,
as I mentioned earlier. It would be unfortunate if the dependency
"castle-game-engine -> gradle" would scare users from installing
"castle-game-engine", as gradle is only useful for creating Android
apps (which will require anyway installing Android SDK and NDK and FPC
cross-compiler to Android). So:
- Either don't declare anything in the package, and only mention in
the package, e.g. in README.Debian, that
"In order to create Android applications, you should also install
the "gradle" package. And the Android SDK and NDK, and FPC
cross-compiler, following
https://github.com/castle-engine/castle-engine/wiki/Android"
- Or make "gradle" suggested by the CGE package, but emphasize in the
description that it's "very optional", like this:
"This package suggests the gradle package. Gradle is only necessary
if you want to build Android applications, otherwise you can ignore
this suggestion. Note that, in order to create Android applications,
you will also need the Android SDK and NDK, and FPC cross-compiler,
following https://github.com/castle-engine/castle-engine/wiki/Android
."
Your choice which version to choose, I'm on the fence here, both
choices feel reasonable to me:)
P.S. Castle Game Engine release 6.0.2 was uploaded this Saturday
evening, so you're free to base your packaging on it. I have not yet
officially announced this release, because SourceForge download
mirrors have problems now (see
https://sourceforge.net/p/forge/site-support/14733/ ). If downloading
from SourceForge manually, be sure to check md5sums:
09a835462bb942164516c6c34581994e castle_game_engine-6.0.2-src.tar.gz
7f6ccd3f4d6a2547299ea4dc9ef0ad15 castle_game_engine-6.0.2-src.zip
I'm hesitating right now between waiting for SourceForge to fix it,
and setting up alternative host for downloads. An unofficial place for
downloads is now on http://45.32.65.95/downloads/ , this is more
reliable than SourceForge now.
Best regards,
Michalis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-gradle-on-path.patch
Type: text/x-diff
Size: 483 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-pascal-devel/attachments/20170321/f0951bba/attachment.patch>
More information about the Pkg-pascal-devel
mailing list