Skip to content

SDL2/Gradle bootstrap #1042

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

Closed
wants to merge 8 commits into from
Closed

SDL2/Gradle bootstrap #1042

wants to merge 8 commits into from

Conversation

tito
Copy link
Member

@tito tito commented May 6, 2017

This is a new SDL2 bootstrap, using gradle for building instead of ant. It can handle natively .aars (Android archive fragments), and external dependencies (fetch & compilation).

Because gradle is something new to everyone here (and me), let's just have a note about how the project structure is different:

Files removed:

ant.properties
build.xml
custom_rules.xml

Files/directory moved:

AndroidManifest.xml -> src/main/AndroidManifest.xml
assets -> src/main/assets
libs [.jar] -> src/main/libs
libs [.so] -> src/main/jniLibs
res -> src/main/res
src -> src/main/java

The jni directory in the root folder should stay for the moment (it should be in src/main/jni), but i get ndkBuild works with Android.mk within jni directory (aka, i can't pass any options)).

@tito tito added the upstream label May 6, 2017
@tito tito requested review from kived and inclement May 6, 2017 16:06
@tito tito changed the title [WIP] SDL2/Gradle bootstrap SDL2/Gradle bootstrap May 6, 2017
@tito
Copy link
Member Author

tito commented May 6, 2017

Well, it works with my app that includes aars + specific gradle dependencies.
Woot woot!

Someone care to test if standard build are not broken?
If not, then we could merge this as it is for now :)

@inclement inclement added this to the 0.5 milestone May 11, 2017
Copy link
Member

@inclement inclement left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost everything works fine, but I get an error that seems to be related to a failure to download gradle:

Downloading https://services.gradle.org/distributions/gradle-3.3-all.zip

Exception in thread "main" javax.net.ssl.SSLException: java.security.ProviderException: java.security.InvalidKeyException: EC parameters error
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1914)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1872)
	at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1855)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1376)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1353)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1348)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
	at org.gradle.wrapper.Download.downloadInternal(Download.java:56)
	at org.gradle.wrapper.Download.download(Download.java:42)
	at org.gradle.wrapper.Install$1.call(Install.java:57)
	at org.gradle.wrapper.Install$1.call(Install.java:44)
	at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
	at org.gradle.wrapper.Install.createDist(Install.java:44)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)
Caused by: java.security.ProviderException: java.security.InvalidKeyException: EC parameters error
	at sun.security.pkcs11.P11Key$P11ECPublicKey.getEncodedInternal(P11Key.java:1024)
	at sun.security.pkcs11.P11Key.equals(P11Key.java:158)
	at java.util.ArrayList.indexOf(ArrayList.java:298)
	at java.util.ArrayList.contains(ArrayList.java:281)
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:239)
	at sun.security.validator.Validator.validate(Validator.java:260)
	at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1459)
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:213)
	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:961)
	at sun.security.ssl.Handshaker.process_record(Handshaker.java:897)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1033)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1342)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1369)
	... 13 more
Caused by: java.security.InvalidKeyException: EC parameters error
	at sun.security.ec.ECParameters.getAlgorithmParameters(ECParameters.java:284)
	at sun.security.ec.ECPublicKeyImpl.<init>(ECPublicKeyImpl.java:59)
	at sun.security.pkcs11.P11Key$P11ECPublicKey.getEncodedInternal(P11Key.java:1021)
	... 28 more
Caused by: java.security.NoSuchProviderException: no such provider: SunEC
	at sun.security.jca.GetInstance.getService(GetInstance.java:83)
	at sun.security.jca.GetInstance.getInstance(GetInstance.java:206)
	at java.security.Security.getImpl(Security.java:697)
	at java.security.AlgorithmParameters.getInstance(AlgorithmParameters.java:199)
	at sun.security.ec.ECParameters.getAlgorithmParameters(ECParameters.java:279)
	... 30 more

The error persists after I install gradle locally. I'll look into it but I haven't used gradle before and I'm not sure what to look for, did you have any problems like this?

Edit: I got gradle itself to run by installing it locally and running directly 'gradle assembleDebug', but it says I haven't agreed to some license agreements. I'll work out how to do that, but not right now. The above error still stands as well.

@@ -271,6 +272,15 @@ def fry_eggs(self, sitepackages):
shprint(sh.mv, '-t', sitepackages, *files)
shprint(sh.rm, '-rf', d)

def apk(self, build_mode, env):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this function actually get called from somewhere? I see the ant/gradle build stuff is handled elsewhere.

@inclement
Copy link
Member

inclement commented Jul 23, 2017

I'm closing this in favour of #1071, which combines everything into the existing sdl2 bootstrap in such a way that both ant and gradle can work. It all seems to work though, and I intend to merge it after doing a release.

@inclement inclement closed this Jul 23, 2017
@tito tito deleted the sdl2_gradle branch January 30, 2019 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants