libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
224 stars 83 forks source link

Add Gradle Support #102

Closed mustii82 closed 8 years ago

mustii82 commented 8 years ago

Please add grade support to this Library most LibGDX Projects are working with Gradle.

noblemaster commented 8 years ago

There is gradle support! Did you read the Wiki?

mustii82 commented 8 years ago

The Wiki just contains Maven integration

psiegel commented 8 years ago

I have also had a ton of trouble getting this working with gradle. I managed to get android, ios, and desktop builds to work, but my html build still throws errors:

[ERROR] Line 20: No source code is available for type com.badlogic.gdx.pay.PurchaseObserver; did you forget to inherit a required module? [ERROR] Line 21: No source code is available for type com.badlogic.gdx.pay.PurchaseManagerConfig; did you forget to inherit a required module?

I've posted about it on the libgdx forums here: http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=22703

mustii82 commented 8 years ago

A small Update on the Wiki with Gradle integration would help.

keesvandieren commented 8 years ago

Improved README a bit. Remaining issues:

What do you think?

keesvandieren commented 8 years ago

@psiegel I have never used GWT. Maybe gdx-pay support for GWT is currently broken?

Is it possible to create a small Github project that reproduces the issue?

I also added to README.md instructoins to use a locally build gdx-pay in a project. Makes trying out changes in gdx-pay a lot easier. See: https://github.com/libgdx/gdx-pay#user-content-using-gdx-pay-locally-build-binaries-in-a-project

noblemaster commented 8 years ago

Why not do both: we give the option to (a) use dependency management or (b) use jars directly whatever developers prefer?

I agree, listing Gradle & Maven dependencies makes sense. I am not much of a Gradle/Maven expert though.

re-GWT: that's currently just an empty stub that does nothing. It needs implementation.

keesvandieren commented 8 years ago

Why not do both: we give the option to (a) use dependency management or (b) use jars directly whatever developers prefer?

Using jars is error-prone, some people forget some of the jars, and blame gdx-pay for ClassNotFound exceptions.

If we use Google as an example (e.g. https://firebase.google.com/docs/storage/android/start ), they just mention the Gradle dependency statements.

If it is still relevant for our users, we should keep it. So now we have at least one important user who needs it :)?

piotrros commented 8 years ago

Finally found how to do this with gradle: http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=22343&p=92098&hilit=pay#p92098

Strange that info like that isn't in README.

keesvandieren commented 8 years ago

The README.md has been extended and now includes instructions for usage with Gradle. The other way to do it (by downloading jars manually) is still there.

If the instructions are not sufficient, please feel free to open a new issue.

Relevant changes in README.md below:

Configure dependencies using Gradle

project-root/build.gradle:

ext {
    gdxPayVersion = '0.10.3'
}

core:

dependencies {
    compile "com.badlogicgames.gdxpay:gdx-pay-client:$gdxPayVersion"
}

android:

dependencies {
    compile "com.badlogicgames.gdxpay:gdx-pay-android:$gdxPayVersion"
    compile "com.badlogicgames.gdxpay:gdx-pay-android-googleplay:${gdxPayVersion}@aar"
}

ios:

dependencies {
    compile "com.badlogicgames.gdxpay:gdx-pay-iosrobovm-apple:$gdxPayVersion"
}

Adding the '@aar' suffix to the dependency is the right way to do it.

If you still think gdx-pay is doing it wrong, feel free to open a new issue.