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

编译源码时有些测试错误 #3

Closed
nobodxbodon opened this issue Jan 8, 2018 · 5 comments
Closed

编译源码时有些测试错误 #3

nobodxbodon opened this issue Jan 8, 2018 · 5 comments
Assignees
Labels

Comments

@nobodxbodon
Copy link

nobodxbodon commented Jan 8, 2018

$ ./build.py
============================
Build Start
============================
--- current version is [0.0.9.1-ALPHA] ---
--- Start to build module [latte-class-recorder] ---
Starting a Gradle Daemon (subsequent builds will be faster)
Generating JAR file 'gradle-api-4.4.1.jar'

BUILD SUCCESSFUL in 24s
5 actionable tasks: 4 executed, 1 up-to-date
--- Start to build module [latte-compiler] ---

> Task :compileJava 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning

> Task :compileTestJava 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning


BUILD SUCCESSFUL in 55s
12 actionable tasks: 11 executed, 1 up-to-date
--- Start to build module [latte-gradle-plugin] ---

> Task :compileGroovy 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning


BUILD SUCCESSFUL in 13s
9 actionable tasks: 8 executed, 1 up-to-date
--- Start to build module [latte-library] ---

> Task :compileLatte 
Compiling latte source files from [/Users/xuanwu/git/Latte-lang/latte-library/src/main/latte/async, /Users/xuanwu/git/Latte-lang/latte-library/src/main/latte/dsl] to [/Users/xuanwu/git/Latte-lang/latte-library/build/classes/main]

> Task :compileTestJava 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning

> Task :compileTestLatte 
Compiling latte source files from [/Users/xuanwu/git/Latte-lang/latte-library/src/test/latte] to [/Users/xuanwu/git/Latte-lang/latte-library/build/classes/test]

> Task :test FAILED

lt.library.TestLibraries > testAsync_each FAILED
    java.lang.ClassNotFoundException at TestLibraries.java:135

lt.library.TestLibraries > testAsync_waterfall FAILED
    java.lang.ClassNotFoundException at TestLibraries.java:111

lt.library.TestLibraries > testHtml FAILED
    java.lang.ClassNotFoundException at TestLibraries.java:40

lt.library.TestLibraries > testAsync_series FAILED
    java.lang.ClassNotFoundException at TestLibraries.java:127

lt.library.TestLibraries > testAsync_parallel FAILED
    java.lang.ClassNotFoundException at TestLibraries.java:119

lt.library.TestLibraries > testAsync_eachSeries FAILED
    java.lang.ClassNotFoundException at TestLibraries.java:143

6 tests completed, 6 failed


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///Users/xuanwu/git/Latte-lang/latte-library/build/reports/tests/test/index.html

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

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
9 actionable tasks: 8 executed, 1 up-to-date
[Errno 2] No such file or directory: 'latte-build/build/distributions/'
@wkgcass
Copy link
Owner

wkgcass commented Jan 9, 2018

hi,请问你的gradle版本是多少呢?从日志来看,有Generating JAR file 'gradle-api-4.4.1.jar',我推测是gradle 4.4.1
从测试用例执行的异常看,应该是gradle插件编译latte代码失败,或者没有放在正确的路径下。
可能是该版本gradle使用的classpath和编译目标目录不一致。

看起来是个兼容性问题,我后续会修复。

你可以暂时使用 gradle 2.14.1 进行编译。./build.py支持指定使用哪个gradle,例如:

./build.py -g gradle2

thx~

@nobodxbodon
Copy link
Author

不好意思我刚开始用gradle. 刚看了那个控制台里的gradle -v是1.11, 是老早装的一个留在path里了.

刚在gradle -v是4.4.1的控制台里跑了一次 ./build.py,还是同样问题.

再运行了建议的命令, 但报错:

$ ./build.py -g gradle2
============================
Build Start
============================
Gradle not found [gradle2]
[Errno 2] No such file or directory: 'latte-build/build/distributions/'

好像官方文档建议使用wrapper并且提交到源码, 以避免gradle版本问题?

@wkgcass
Copy link
Owner

wkgcass commented Jan 10, 2018

你需要先下载gradle2.14.1,最好将其bin目录export到PATH中。可选的,你可以修改bin目录下的命令行脚本名,比如把$path_to_your/bin/gradle修改为gradle2

-g选项只是单纯的选择一个gradle执行文件而已。

关于wrapper,由于Latte-lang提供gradle插件,所以兼容性是需要适配的,也就没必要使用wrapper了。所以若出现插件对某个gradle不兼容,我会视为一个bug处理

@wkgcass wkgcass added the bug label Jan 10, 2018
@wkgcass wkgcass self-assigned this Jan 10, 2018
@wkgcass
Copy link
Owner

wkgcass commented Mar 11, 2018

最新的版本这个问题已经修复了~试试看吧

@nobodxbodon
Copy link
Author

多谢!

$ gradle -v

------------------------------------------------------------
Gradle 4.4.1
------------------------------------------------------------

Build time:   2017-12-20 15:45:23 UTC
Revision:     10ed9dc355dc39f6307cc98fbd8cea314bdd381c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_45 (Oracle Corporation 25.45-b02)
OS:           Mac OS X 10.13.3 x86_64


$ ./build.py
============================
Build Start
============================
--- current version is [0.0.10-ALPHA] ---
--- Start to build module [latte-class-recorder] ---
Starting a Gradle Daemon (subsequent builds will be faster)

BUILD SUCCESSFUL in 9s
5 actionable tasks: 5 executed
--- Start to build module [latte-compiler] ---

> Task :compileJava 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning

> Task :compileTestJava 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning


BUILD SUCCESSFUL in 58s
12 actionable tasks: 12 executed
--- Start to build module [latte-gradle-plugin] ---

> Task :compileGroovy 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning


BUILD SUCCESSFUL in 5s
9 actionable tasks: 9 executed
--- Start to build module [latte-library] ---

> Task :compileLatte 
gradle version is 4.4.1
Compiling latte source files from [/Users/xuanwu/git/Latte-lang-original/latte-library/src/main/latte/async, /Users/xuanwu/git/Latte-lang-original/latte-library/src/main/latte/dsl] to [/Users/xuanwu/git/Latte-lang-original/latte-library/build/classes/java/main]

> Task :compileTestJava 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning

> Task :compileTestLatte 
gradle version is 4.4.1
Compiling latte source files from [/Users/xuanwu/git/Latte-lang-original/latte-library/src/test/latte] to [/Users/xuanwu/git/Latte-lang-original/latte-library/build/classes/java/test]


BUILD SUCCESSFUL in 5s
10 actionable tasks: 10 executed
--- Start to build module [latte-build] ---
Download https://repo.maven.apache.org/maven2/jline/jline/2.14.2/jline-2.14.2.pom
Download https://repo.maven.apache.org/maven2/jline/jline/2.14.2/jline-2.14.2.jar

> Task :compileJava 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
/Users/xuanwu/git/Latte-lang-original/latte-build/src/main/java/lt/repl/CtrlCSignalHandler.java:3: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
               ^
/Users/xuanwu/git/Latte-lang-original/latte-build/src/main/java/lt/repl/CtrlCSignalHandler.java:4: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
               ^
/Users/xuanwu/git/Latte-lang-original/latte-build/src/main/java/lt/repl/CtrlCSignalHandler.java:14: warning: SignalHandler is internal proprietary API and may be removed in a future release
                SignalHandler handler = new SignalHandler() {
                ^
/Users/xuanwu/git/Latte-lang-original/latte-build/src/main/java/lt/repl/CtrlCSignalHandler.java:14: warning: SignalHandler is internal proprietary API and may be removed in a future release
                SignalHandler handler = new SignalHandler() {
                                            ^
/Users/xuanwu/git/Latte-lang-original/latte-build/src/main/java/lt/repl/CtrlCSignalHandler.java:18: warning: Signal is internal proprietary API and may be removed in a future release
                        public void handle(Signal signal) {
                                           ^
/Users/xuanwu/git/Latte-lang-original/latte-build/src/main/java/lt/repl/CtrlCSignalHandler.java:45: warning: Signal is internal proprietary API and may be removed in a future release
                Signal.handle(new Signal("INT"), handler);
                                  ^
/Users/xuanwu/git/Latte-lang-original/latte-build/src/main/java/lt/repl/CtrlCSignalHandler.java:45: warning: Signal is internal proprietary API and may be removed in a future release
                Signal.handle(new Signal("INT"), handler);
                ^
8 warnings


BUILD SUCCESSFUL in 4s
10 actionable tasks: 9 executed, 1 up-to-date
============================
Build Successful
============================
Total time: 87.529 secs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants