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

Handle dependency management trough gradle. #5

Merged
merged 4 commits into from Aug 9, 2016
Merged

Handle dependency management trough gradle. #5

merged 4 commits into from Aug 9, 2016

Conversation

ghost
Copy link

@ghost ghost commented Aug 9, 2016

This PR intends to change how dependencies are handled and how binaries are built and thus closes #4

Additionally:

  • DMI now uses InputStream as the default constructor to prevent needless object conversions.
  • We can now generate cross-platform jars using gradlew fatCapsule

@ghost ghost mentioned this pull request Aug 9, 2016
@monster860
Copy link
Owner

monster860 commented Aug 9, 2016

Please make sure to add instructions to README.MD

Also, have you actually tested this?

@ghost
Copy link
Author

ghost commented Aug 9, 2016

@monster860 Yes this has been tested, and should be fine to merge.

@monster860
Copy link
Owner

When I attempt to build, this happens:

The AbstractTask.setName() method has been deprecated and is scheduled to be removed in Gradle 3.0.
com.stehno.gradle.natives.NativesPluginExtension_Decorated@51bb39f4
:compileJava
C:\Users\monster861\Documents\GitHub\FastDMM\src\main\java\com\github\monster860\fastdmm\dmmmap\TileInstance.java:73: error: cannot find symbol
                        cachedSorted.sort(new Comparator<ObjInstance>(){
                                    ^
  symbol:   method sort(<anonymous Comparator<ObjInstance>>)
  location: variable cachedSorted of type List<ObjInstance>
C:\Users\monster861\Documents\GitHub\FastDMM\src\main\java\com\github\monster860\fastdmm\objtree\ObjectTree.java:232: error: cannot find symbol
                        i.subtypes.sort(new Comparator<Item>(){
                                  ^
  symbol:   method sort(<anonymous Comparator<Item>>)
  location: variable subtypes of type ArrayList<Item>
2 errors
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 9.487 secs

@ghost
Copy link
Author

ghost commented Aug 9, 2016

i.subtypes.sort(new Comparator<Item>(){

is using an API that is only present in Java 8 and has the annotation I've updated the scripts to reflect this.

Interestingly enough i haven't seen this error, but that might be because i only run Java 8 on my system.

If you are encountering any errors in the future, please run

λ gradlew --version

------------------------------------------------------------
Gradle 2.14.1
------------------------------------------------------------

Build time:   2016-07-18 06:38:37 UTC
Revision:     d9e2113d9fb05a5caabba61798bdb8dfdca83719

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_77 (Oracle Corporation 25.77-b03)
OS:           Windows 10 10.0 amd64

@monster860
Copy link
Owner

monster860 commented Aug 9, 2016

The AbstractTask.setName() method has been deprecated and is scheduled to be removed in Gradle 3.0.
com.stehno.gradle.natives.NativesPluginExtension_Decorated@443c685a
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> invalid source release: 1.8

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7.287 secs

Yes, I have java 8 jdk installed

@ghost
Copy link
Author

ghost commented Aug 9, 2016

Please run gradlew --version and check it's output.

@monster860
Copy link
Owner

monster860 commented Aug 9, 2016

------------------------------------------------------------
Gradle 2.14.1
------------------------------------------------------------

Build time:   2016-07-18 06:38:37 UTC
Revision:     d9e2113d9fb05a5caabba61798bdb8dfdca83719

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.7.0_75 (Oracle Corporation 24.75-b04)
OS:           Windows 8.1 6.3 amd64

@ghost
Copy link
Author

ghost commented Aug 9, 2016

Your JAVA_HOME is set to the wrong JVM, it's picking up 1.7 instead of 1.8

@monster860
Copy link
Owner

Attempting to run the output gives me:

CAPSULE: Dependency manager repositories: [central (https://repo1.maven.org/maven2/, default, releases)]
CAPSULE: Launching app com.github.monster860.fastdmm.FastDMM
CAPSULE: Locking C:\Users\monster861\AppData\Local\capsule\apps\com.github.monster860.fastdmm.FastDMM\.lock
CAPSULE: Extracting C:\Users\monster861\Documents\GitHub\FastDMM\build\libs\fastdmm-1.0-SNAPSHOT-capsule.jar to app cache directory C:\Users\monster861\AppData\Local\capsule\apps\com.github.monster860.fastdmm.FastDMM
CAPSULE: Error parsing Java version 1.8.0_101
CAPSULE: Unocking C:\Users\monster861\AppData\Local\capsule\apps\com.github.monster860.fastdmm.FastDMM\.lock
CAPSULE EXCEPTION: null while processing system property java.home: C:\Program Files\Java\jre1.8.0_101
java.lang.NullPointerException
        at java.util.HashMap.putMapEntries(Unknown Source)
        at java.util.HashMap.putAll(Unknown Source)
        at Capsule.windowsJavaHomesHeuristics(Capsule.java:3110)
        at Capsule.getJavaHomes(Capsule.java:3093)
        at Capsule.findJavaHome(Capsule.java:2169)
        at Capsule.chooseJavaHome0(Capsule.java:2150)
        at Capsule.chooseJavaHome(Capsule.java:2138)
        at Capsule.getJavaHome(Capsule.java:2125)
        at Capsule.getJavaExecutable0(Capsule.java:1664)
        at Capsule.getJavaExecutable(Capsule.java:1656)
        at Capsule.buildJavaProcess(Capsule.java:1609)
        at Capsule.buildProcess0(Capsule.java:1176)
        at Capsule.buildProcess(Capsule.java:1167)
        at Capsule.prelaunch0(Capsule.java:1145)
        at Capsule.prelaunch(Capsule.java:1141)
        at Capsule.prepareForLaunch(Capsule.java:1056)
        at Capsule.launch(Capsule.java:996)
        at Capsule.main0(Capsule.java:287)
        at Capsule.main(Capsule.java:266)

@ghost
Copy link
Author

ghost commented Aug 9, 2016

😠 You'd think they would mention things like this in their documentation, the latest commit should resolve this error.

Please ensure you delete your build directory, and force a completely fresh build 👍

@monster860
Copy link
Owner

Okay, it works now.

@monster860 monster860 merged commit eb6ee72 into monster860:master Aug 9, 2016
@ghost ghost deleted the gradle branch August 9, 2016 20:14
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.

Questions regarding packaging.
1 participant