Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #33549 > unrolled thread
| Started by | ruben <ceo@iran.gov> |
|---|---|
| First post | 2016-01-30 22:18 +0000 |
| Last post | 2016-01-30 22:18 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.java.programmer
gradle and main ruben <ceo@iran.gov> - 2016-01-30 22:18 +0000
| From | ruben <ceo@iran.gov> |
|---|---|
| Date | 2016-01-30 22:18 +0000 |
| Subject | gradle and main |
| Message-ID | <n8jcqp$l4j$1@reader1.panix.com> |
I have a problem trying to understand why I am not getting a main class
in this situation that I inherited from another developer.
We have this file stack
/home/ruben/src/grad_school/compiler/cl/cs664pub/assn2
[ruben@localhost assn2]$ ls -R
.:
assn2.iml build build.gradle src
./build:
classes dependency-cache libs reports test-results tmp
./build/classes:
main test
./build/classes/main:
pico
./build/classes/main/pico:
Lexer.class LexError.class LexerTest.class Token$1.class Token.class
Token$Type.class
./build/classes/test:
pico
./build/classes/test/pico:
Lexer.class LexError.class LexerTest.class Token$1.class Token.class
Token$Type.class
./build/dependency-cache:
./build/libs:
assn2.jar
./build/reports:
tests
./build/reports/tests:
classes css index.html js packages
./build/reports/tests/classes:
pico.LexerTest.html
./build/reports/tests/css:
base-style.css style.css
./build/reports/tests/js:
report.js
./build/reports/tests/packages:
pico.html
./build/test-results:
binary TEST-pico.LexerTest.xml
./build/test-results/binary:
test
./build/test-results/binary/test:
output.bin output.bin.idx results.bin
./build/tmp:
compileJava compileTestJava jar test
./build/tmp/compileJava:
emptySourcePathRef
./build/tmp/compileJava/emptySourcePathRef:
./build/tmp/compileTestJava:
emptySourcePathRef
./build/tmp/compileTestJava/emptySourcePathRef:
./build/tmp/jar:
MANIFEST.MF
./build/tmp/test:
jar_extract_5436676970741162728_tmp jar_extract_670793962990210545_tmp
jar_extract_5553300584768142368_tmp
./src:
pico
./src/pico:
Lexer.java LexError.java LexerTest.java Token.java
gradle build config is:
[ruben@localhost assn2]$ cat build.gradle
apply plugin: 'java'
sourceSets {
main {
java {
srcDir 'src'
}
}
test {
java {
srcDir 'src'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'junit', name: 'junit', version: '4.+'
compile group: 'com.google.guava', name: 'guava', version: '19.+'
}
TWO classes have main
[ruben@localhost assn2]$ cd ./src/pico/
[ruben@localhost pico]$ ls
Lexer.java LexError.java LexerTest.java Token.java
[ruben@localhost pico]$ grep main ./*
grep: ./.gradle: Is a directory
./Lexer.java: public static void main(String[] args) {
Binary file ./.Lexer.java.swp matches
./Token.java: public static void main(String[] args) {
Build as follows:
[ruben@localhost pico]$
[ruben@localhost pico]$ cd ..
[ruben@localhost src]$ cd ..
[ruben@localhost assn2]$ gradle build
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test
pico.LexerTest > testStringQuotedParens FAILED
java.lang.AssertionError at LexerTest.java:240
pico.LexerTest > testBasicString FAILED
java.lang.AssertionError at LexerTest.java:240
// ... more unimportant tests
pico.LexerTest > testBlockDefinition FAILED
java.lang.AssertionError at LexerTest.java:240
31 tests completed, 28 failed
:test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///home/ruben/src/
grad_school/compiler/cl/cs664pub/assn2/build/reports/tests/index.html
* 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: 4.432 secs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nothing failed but the tests which are supposed to fail at this point.
[ruben@localhost assn2]$ cd build/classes/main/
[ruben@localhost main]$ pwd
/home/ruben/src/grad_school/compiler/cl/cs664pub/assn2/build/classes/main
[ruben@localhost main]$ ls
pico
[ruben@localhost main]$ cd pico/
[ruben@localhost pico]$ ls
Lexer.class LexError.class LexerTest.class Token$1.class Token.class
Token$Type.class
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexer won't run
[ruben@localhost pico]$ java Lexer
Error: Could not find or load main class Lexer
Token won't either
[ruben@localhost pico]$ java Token
Error: Could not find or load main class Token
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ruben@localhost pico]$ set |grep CLASS
CLASSPATH=/home/ruben/GNUstep/Library/Libraries/Java:/root/GNUstep/
Library/Libraries/Java:/usr/lib/GNUstep/Libraries/Java:./.
Back to top | Article view | comp.lang.java.programmer
csiph-web