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

Using maven build to only build java target #1005

Closed
HSorensen opened this issue Sep 28, 2015 · 5 comments
Closed

Using maven build to only build java target #1005

HSorensen opened this issue Sep 28, 2015 · 5 comments

Comments

@HSorensen
Copy link
Contributor

I am sure there is a way to do this but even after studying the messages from mavan and looking at the antlr wiki I have not figured out a way to instruct maven to build just the java target.

Any help is appreciated.

@ericvergnaud
Copy link
Contributor

A target comprises a few tool files, and a runtime.
The maven build incorporates the tool files, but not sure why you'd want to exclude them.
It also tests all the target runtimes. This can be configured by commenting out the corresponding lines in the runtime test suite pom.xml.

@HSorensen
Copy link
Contributor Author

I should have looked at bit closer. It is when the tests cases are running for C#, JavaScript, Python2 and Python3. My system is not setup for executing these targets.

So I'll rephrase my question can I suppress tests such that only the test cases for the Java target are executed.

Csharp

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.antlr.v4.test.runtime.csharp.TestCompositeLexers
dir C:\Users\076946\AppData\Local\Temp\TestCompositeLexers-1443545976713
Starting build "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" /p:Configuration=Release C:\Users\076946\AppData\Local\Temp\TestCompositeLexers-1443545976713\Antlr4.Test.mono.csproj
buildProject stderrVacuum: Microsoft (R) Build Engine version 12.0.30723.0
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 9/29/2015 9:59:46 AM.
Project "C:\Users\076946\AppData\Local\Temp\TestCompositeLexers-1443545976713\Antlr4.Test.mono.csproj" on node 1 (default targets).
PrepareForBuild:
  Creating directory "bin\Release\".
  Creating directory "obj\Release\".
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1288,5): error MSB4018: The "AssignProjectConfiguration" task failed unexpectedly. [C:\Users\076946\AppData\Local\Temp\TestCompositeLexers-1443545976713\Antlr4.Test.mono.csproj]
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1288,5): error MSB4018: System.InvalidOperationException: The item metadata "%(FullPath)" cannot be applied to the path "\C:\Users\076946\git\antlr4\runtime-testsuite\target\classes\CSharp\runtime\CSharp\Antlr4.Runtime\Antlr4.Runtime.vs2013.csproj". The given path's format is not supported. [C:\Users\076946\AppData\Local\Temp\TestCompositeLexers-1443545976713\Antlr4.Test.mono.csproj]
Done Building Project "C:\Users\076946\AppData\Local\Temp\TestCompositeLexers-1443545976713\Antlr4.Test.mono.csproj" (default targets) -- FAILED.

Javascript

testLexerDelegatorInvokesDelegateRule(org.antlr.v4.test.runtime.javascript.node.TestCompositeLexers)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NullPointerException
    at java.io.File.<init>(File.java:277)
    at org.antlr.v4.test.runtime.javascript.node.BaseTest.locateNodeJS(BaseTest.java:435)
    at org.antlr.v4.test.runtime.javascript.node.BaseTest.execModule(BaseTest.java:379)
    at org.antlr.v4.test.runtime.javascript.node.BaseTest.execLexer(BaseTest.java:302)

Python2

testDelegatorAccessesDelegateMembers(org.antlr.v4.test.runtime.python2.TestCompositeParsers)  Time elapsed: 0.032 sec  <<< ERROR!
java.lang.RuntimeException: Could not locate python2.7
    at org.antlr.v4.test.runtime.python.BasePythonTest.locateTool(BasePythonTest.java:562)
    at org.antlr.v4.test.runtime.python.BasePythonTest.locatePython(BasePythonTest.java:569)

Python3

testLexerDelegatorInvokesDelegateRule(org.antlr.v4.test.runtime.python3.TestCompositeLexers)  Time elapsed: 0.016 sec  <<< ERROR!
java.lang.RuntimeException: Could not locate python3.4
    at org.antlr.v4.test.runtime.python.BasePythonTest.locateTool(BasePythonTest.java:562)
    at org.antlr.v4.test.runtime.python.BasePythonTest.locatePython(BasePythonTest.java:569)

@ericvergnaud
Copy link
Contributor

as mentioned, This can be configured by commenting out the corresponding lines in the runtime test suite pom.xml.

@sharwell
Copy link
Member

I see this issue as an enhancement request to move the tests for each target into a Maven profile which is enabled by default but can be disabled on the command line.

@jimidle
Copy link
Collaborator

jimidle commented Sep 30, 2015

Could auto enable the profile only if it meets certain criteria, such as
the presence of the tests and the python runtime etc. Then if you don't
want the other runtime test, just delete the directory and mvn won't
activate those profiles.

Anyway, I also agree that this is a maven profile thing in one way or
another.

Jim

On Wed, Sep 30, 2015 at 8:26 AM, Sam Harwell notifications@github.com
wrote:

I see this issue as an enhancement request to move the tests for each
target into a Maven profile which is enabled by default but can be disabled
on the command line.


Reply to this email directly or view it on GitHub
#1005 (comment).

@parrt parrt closed this as completed Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants