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

Fix gradle build #1609

Closed
TimLethbridge opened this issue Jul 23, 2020 · 8 comments
Closed

Fix gradle build #1609

TimLethbridge opened this issue Jul 23, 2020 · 8 comments
Assignees
Labels
Component-Builder Diffic-Easy Should be obvious how to fix it and doable in less than a week by an experienced Umple developer gradle Related to Gradle building Priority-Medium This problem or request is likely to be of significant benefit if dealt with

Comments

@TimLethbridge
Copy link
Member

Umple can be built using gradle (since issue #751 pr #1418

./gradelw fullbuild
./gradlew testall

However, There are three problems.

  1. is not ready for Gradle 5. The following errors are noted:
The Task.leftShift(Closure) method has been deprecated. This is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_9v440bwisy8jt4wkxrmgpdqw8$_run_closure11.doCall(/Users/tcl/unix/umple/build.gradle:174)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Gradle now uses separate output directories for each JVM language, but this build assumes a single directory for all classes from a source set. This behaviour has been deprecated and is scheduled to be removed in Gradle 5.0.
        at build_9v440bwisy8jt4wkxrmgpdqw8$_run_closure21$_closure83.doCall(/Users/tcl/unix/umple/build.gradle:308)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
The task name 'sandbox:compileJava' contains at least one of the following characters: [ , /, \, :, <, >, ", ?, *, |]. This has been deprecated and is scheduled to be removed in Gradle 5.0.
        at build_9v440bwisy8jt4wkxrmgpdqw8.run(/Users/tcl/unix/umple/build.gradle:490)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Processing -> /Users/tcl/unix/umple/UmpleTToJunit/UmpleTLTemplates/Master.ump
  1. It may not be doing the junit tests.

  2. Finally testing fails on the testbed because it tries to compile a file that deliberately has an error

> Task :javaTestbedCompileUmple
java -jar /Users/tcl/unix/umple/dist/gradle/libs/umple-1.29.1.5052.60297f90e.jar /Users/tcl/unix/umple/testbed/src/runtime/SameFunctionFirst.ump 

> Task :javaTestbedCompile
/Users/tcl/unix/umple/testbed/test/cruise/compiler/src-gen-umple/MismatchedBrackets.java:31: error: illegal start of expression
            if (i % 2)) {

As a result it is commented out in .travis.yml When this issue is fixed, it should be reactivated in travis.

TimLethbridge added a commit that referenced this issue Jul 23, 2020
Progress on #751: Initial attempt at Gradle builds More work later to be done in issue #1609
@TimLethbridge TimLethbridge added Component-Builder gradle Related to Gradle building Diffic-Easy Should be obvious how to fix it and doable in less than a week by an experienced Umple developer Priority-Medium This problem or request is likely to be of significant benefit if dealt with labels Jul 24, 2020
@WeiqiMaster WeiqiMaster self-assigned this Aug 27, 2020
@WeiqiMaster
Copy link
Contributor

WeiqiMaster commented Aug 28, 2020

Running command 'testall' will produce a failure:

> Task :javaTestbedCompile
/home/jpan/eclipse-workspace/umple/testbed/test/cruise/compiler/src-gen-umple/MismatchedBrackets.java:31: error: illegal start of expression
            if (i % 2)) {
                      ^
1 error

> Task :javaTestbedCompile FAILED

FAILURE: Build failed with an exception.

@TimLethbridge
Copy link
Member Author

Yes. I am aware of the testall issue. It needs debugging. Some code designed explicitly to test that the parser works with bad code is in fact being compiled in gradle! The Ant has something somewhere to avoid this

@RalphNgassa
Copy link
Contributor

Resolved the Task.leftshift issue as well as the sandbox task name.

The sole problem persisting is "Gradle now uses separate output directories for each JVM language" which might be the most complex one.

I will push the the edited files within the next 24hrs

@RalphNgassa
Copy link
Contributor

Update: "umple-1.30.2.5351.39f98379d.jar" is missing as well as the whole "gradle" folder inside umple/dist

@TimLethbridge
Copy link
Member Author

That jar file will have to be downloaded automatically on a first-build, same as happens in ant scripts.

@RalphNgassa
Copy link
Contributor

Testall issue resolved-- the incorrect code is now being ignored.
'packagedocs' command has now being added, which is used to locally update user manual once modifications have been made.
'packageumpleonline' command will soon be fully implemented.

Note: A few depraction messages are still present

@TimLethbridge
Copy link
Member Author

I merged PR #1716 so we have a checkpoint. However this issue is not fully resolved, and some more progress is needed. Please refer to the numbers below when commenting.

What I did: I ran

./gradlew tasks
./gradlew firstbuild
./gradlew fullbuild
./gradlew testall  

Observations:

  1. ./gradlew tasks does not list the tasks. In fact it lists generic Java tasks. It should I believe list all the relevant umple tasks such as fullbuild.

  2. At the end of fullbuild I notice that the file build/umpleversion.last.txt has been modified. This should not be modified or needs resetting.

  3. The main tests are not being run. After packaging, fullbuild immediately runs the :allUserManualAndExampleTests but this is only supposed to be the final set of tests after unit tests and the testbed tests. The unit tests are not being run at all. The testbed tests seem to be being run in testall, but not in fullbuild.

  4. There needs to be a quickbuild task that builds without testing (fullbuild should do all the tests, but quickbuild should skip testing).

  5. Is the user manual being built? It should be buildable by itself, and also in fullbuild.

  6. Can you tell me where the final jars that are built are being put? From the ant build they are being put in dist, and a symbolic link is being created to umple.jar so that the next build will use the previous build, hence bootstrapping.

  7. The testall fails ... the following is the end of the trace:

> Task :javaTestbedCompileUmple
java -jar /Users/tcl/unix/github/umple/dist/gradle/libs/umple-1.30.2.5520.94829f2a4.jar /Users/tcl/unix/github/umple/testbed/src/runtime/SameFunctionFirst.ump 

> Task :javaTestbedCompile
/Users/tcl/unix/github/umple/testbed/test/cruise/compiler/src-gen-umple/MismatchedBrackets.java:31: error: illegal start of expression
            if (i % 2)) {
                      ^
1 error

> Task :javaTestbedCompile FAILED

FAILURE: Build failed with an exception.

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

@TimLethbridge
Copy link
Member Author

This seems to be for the most part solved. Any other issues with Gradle would need to be separate issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component-Builder Diffic-Easy Should be obvious how to fix it and doable in less than a week by an experienced Umple developer gradle Related to Gradle building Priority-Medium This problem or request is likely to be of significant benefit if dealt with
Projects
None yet
Development

No branches or pull requests

3 participants