Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33549

gradle and main

Path csiph.com!feeder.erje.net!2.us.feeder.erje.net!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail
From ruben <ceo@iran.gov>
Newsgroups comp.lang.java.programmer
Subject gradle and main
Date Sat, 30 Jan 2016 22:18:01 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 206
Message-ID <n8jcqp$l4j$1@reader1.panix.com> (permalink)
NNTP-Posting-Host www.mrbrklyn.com
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace reader1.panix.com 1454192281 21651 96.57.23.82 (30 Jan 2016 22:18:01 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Sat, 30 Jan 2016 22:18:01 +0000 (UTC)
User-Agent Pan/0.140 (Chocolate Salty Balls; GIT e424b98 git://git.gnome.org/pan2)
Xref csiph.com comp.lang.java.programmer:33549

Show key headers only | View raw


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 comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread


Thread

gradle and main ruben <ceo@iran.gov> - 2016-01-30 22:18 +0000

csiph-web