w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » ANT » Page 1
How to pass variables from ANT to Jenkins job
You would need to save the property into a file. Then use EnvInject plugin to load the property file as environment variables

Categories : Ant

Gradle: failed to create task or type taskDef, name is undefined
taskdef is case sensitive and should be all lowercase: task distMac(dependsOn: assemble) << { println "Create MacOSX distribution....." println "Classpath: " + configurations.jarbundler.asPath ant.taskdef(name: 'jarbundler', classname: 'net.sourceforge.jarbundler.JarBundler', classpath: configurations.jarbundler.asPath) }

Categories : Ant

errors when using Guava to get the private domain name
InternetDomainName does not have a name() method. It did up until 15.0, but it was removed in 16.0. Use toString().

Categories : Ant

How to compare int & float in Build ANT
Using the <script> command you can execute arbirary java/javascript code and do not supported code. For your case, perhaps some similar to : <scriptdef name="compare" language="javascript"> <attribute name="first" /> <attribute name="seccond" /> <![CDATA[ var first = attributes.get("first"); var second = attributes.get("second"); var r

Categories : Ant

Ant failing to find Ivy jar although jar is in ~/.ant/lib
It's due to the XML namespace declaration in the buildfile: xmlns:ivy="antlib:org.apache.ivy.ant" Since the prefix ivy: is being used, the uri attribute is needed in the taskdef task to allow calling the task with the prefix: An example is shown in the typedef documentation: uri: The uri that this definition should live in. since Ant 1.6 EDIT: The antlib indicates that Ant by default can

Categories : Ant

antlr4 grammar-locals clause doesn't generate variable declaration in Parser
thanks to @Lucas I figured it out: ompParallel locals [static java.util.HashSet<String> names] @init { OmpParallelContext.names = new java.util.HashSet<String>(); } : PARALLEL modifiers ; One needs to define the variable statically in order to access it from different class. Unfortunately ANTLR4 generated Parser code seems to be little clumsy.

Categories : Ant

ANTLR4 : parsing legacy web templates
You have the arbitrary macro-expansion problem. In essence, you have raw text ("sea of html") containing macros to be expanded into more "sea of text". The problem is that the macros can occur in arbitrary places, violating any "structure" your sea might have; in fact, the invoked macro may be the source of apparently missing structure. (From your examples, the only concession is that you do no

Categories : Ant

get ANT_HOME for configured ant in shell
JAVA_HOME is setting when you select an ANT Step, the shell script will use the ANT_HOME setted on the server as environment variable. A solution is write the ANT_HOME value during an ANT task on a file on the workspace. <echo message="${ant.home}" file="anthome.txt" /> The shell script read this file and use it for launch ant targets. FOR /F %i IN (anthome.txt) DO SET ANT_HOME=%i In

Categories : Ant

Why does Gradle always call an ant task first?
This is a very common confusion with Gradle. In your example above you are executing the Ant tasks during project configuration. What you really intended was for it to run during task execution. To fix this, your execution logic should be placed within a task action, either by using a doLast {...} configuration block or using the left shift (<<) operator. task checkDependencies << {

Categories : Ant

Failing ant.junit in gradle build
Which version of gradle are you using? With version 2.2.1, ant.junit(printsummary: 'on', showoutput: 'yes', haltonfailure: 'no', failureproperty: 'failed', errorproperty: 'errored') { } ant.fail(if: 'failed') ant.fail(if: 'errored') does work for me. You can even confirm that by trying this simple code: ant.failed = 'true' ant.fail(if: 'failed')

Categories : Ant

How to capture the return value of java from ant build file
The ant java task has several attributes that create a property : resultproperty (= rc) : The name of a property in which the return code of the command should be stored. Only of interest if failonerror=false and if fork=true. outputproperty (= stdout) : The name of a property in which the output of the command should be stored. Unless the error stream is redirected to a separate fil

Categories : Ant

Antlr4 match whole input string or bust
The error recovery mechanism when input is reached which no lexer rule matches is to drop a character and continue with the next one. In your case, the lexer is dropping the 4 character, so your parser is seeing the equivalent of this input: a The solution is to instruct the lexer to create a token for the dropped character rather than ignore it, and pass that token on to the parser where an er

Categories : Ant

Ant JUnit task: Is there a difference between on, yes, and true?
From http://ant.apache.org/manual/develop.html: The most common way to write an attribute setter is to use a java.lang.String argument. In this case Ant will pass the literal value (after property expansion) to your task. But there is more! If the argument of you setter method is boolean, your method will be passed the value true if the value specified in the build file is one of true,

Categories : Ant

Ant task to list files on https
Among the list of HTTP methods, there is no action that allows to "list" files. HTTP is a protocol for transferring content like HTML and it depends on how the server responds to the URI request. The closest task I can think of is get: <get src="https://some_address/" dest="output.txt" /> You would then need to parse the output to retrieve the list of files. Another option (though never

Categories : Ant

BUILD FAILED and didn't generate report when executing junit test cases through ANT
The Junit tests are run in the absolutexpath and relativexpath targets. i don't see either of those in "depends" attributes. Your output implies they aren't run either. Also, you get the message: C:Windows ull231041511 (Access is denied) Can you point to a directory that you have read and write access to like c: emp?

Categories : Ant

Antlr4 parser not handling custom token types
If memory serves, Ter posted a design document on the Antlr.org site that outlines the differences between Antlr3 and 4 (cannot seem to find it at the moment). In any case, make sure your custom token extends org.antlr.v4.runtime.CommonToken. The supported Antlr4 Action attributes are listed here. The start attribute is valid on a parser rule, but not on a token. Note also that many of the t

Categories : Ant

ANTLR semantic predicate - consume only part of the match
My solution: REPEAT_OP1 : '<' REPEAT '>' { setText(getText().substring(1, getText().length()-1)); } ; REPEAT_OP2 : '<' REPEAT { setText(getText().substring(1, getText().length())); } ; repeatOperator : REPEAT_OP1 | REPEAT_OP2 WEIGHT_OR_PROBABILITY? SHARP_BRACKET_RIGHT | REPEAT_OP2 WEIGHT_OR_PROBABILITY? {notifyErrorListeners("Missing closing '>'

Categories : Ant

Ant: Is it possible to replace command line options with build.xml attributes?
Try something like this to replace the "-lib" parameter: <path id="task.path"> <pathelement location="/Applications/HP_Fortify/HP_Fortify_SCA_and_Apps_4.10/Core/lib/sourceanalyzer.jar"/> </path> <typedef name="fortify" classname="com.fortify.dev.ant.SourceanalyzerTask" classpathref="task.path"/>

Categories : Ant

Detecting missing characters in ANTLR v4 parser
One way is to use a mode to isolate the syntax of what constitutes a valid string: StrStart: '"' -> pushMode(strMode) ; mode strMode; ValidStringChar: [a-zA-Z ... ]+ ; StrEnd: '"' -> popMode; InvalidStrChar1: '>' -> popMode, type(RAngle); InvalidStrChar2: ';' -> popMode, type(Semi); ... When the parser fails to find an alternative in the ca

Categories : Ant

MonkeyTalk with ANT runner
For Dynamic instrumentation, you can try below sample Ant script: <target name="instru"> <mt:instrument src="/path/to/MyApp.apk" dest="/path/to/MyApp-Instrumented.apk" agent="/path/to/monkeytalk-agent-2.0.2.jar" androidSdk="/path/to/android-sdk" androidTarget="android-19" log="log.txt" verbose="true" /> </target>

Categories : Ant

ant property file overwritten by property task
In ant a property once set is immutable by design. There is no specific order when using different mechanisms to create a property - the first declaration of the property wins. Given propertyfile foo.properties has : JAVA_HOME=some/path Example script <project> <property file="foo.properties"/> <property name="JAVA_HOME" value="foobar"/> <property environment="env"

Categories : Ant

Ant zip: how to remove original directory from the path
Why don't you try copying the folder structure to a temp folder and try zipping it? https://ant.apache.org/manual/Tasks/copydir.html https://ant.apache.org/manual/Tasks/zip.html

Categories : Ant

How use property expansion in a Launch4j config file
The code of launch4j did not accept such replacements of parameters, but I could change this behaviour (modifications to net.sf.launch4j.config.ConfigPersister). I check it in the Sourceforge project when I have enough time for it.

Categories : Ant

Why do I get '[eclipse.brand] Could not find executable to brand' when building my Eclipse RCP from console?
You need the Equinox Executable Plug-In in your target platform: org.eclipse.equinox.executable Here's another good source for common answers to export problems: http://www.vogella.com/tutorials/EclipseProductDeployment/article.html

Categories : Ant

Ant war and ear is not generating
Your question implies that you have written code that you expect to generate a WAR, but you have no instruction to do so. I see from your comment you are actually asking what the command should be. Most important: I hope we are all new to things, after 35 years in the industry I learn something every day. Why did you ask the question rather than google? Learning to search is the most important s

Categories : Ant

Antlr4 channels behavior
Hard to say why it behaved as you say, but the compound/conflicting use of * and + on and in PASS_THROUGH_CHAR is the root cause. Below is what I think you were trying to accomplish. START_LITERAL: '{/literal}' -> pushMode(PASS_THROUGH); mode PASS_THROUGH; END_LITERAL: '{/literal}' -> popMode; PASS_THROUGH_CHAR: . -> more, channel( TEXT ); Updated: I have not tr

Categories : Ant

Building a Jar of a Frege project using Gradle
If your module name in Frege is unqualified such as HelloWorld, you will not see the package statement generated in Java. The module name will become the class name and the package will be empty or default package. If your module name is qualified such as foo.bar.HelloWorld, then foo.bar will be the package name and HelloWorld will be the class name in the generated Java source. The rule is that

Categories : Ant

ANTLR4 Token is not recognized when substituted
I presume "and" is an IDENTIFIER since the rule for IDENTIFIER comes before the rule for AND and thus wins. If you write 'and' in the parser rule this implicitly creates a token (not AND!) which comes before IDENTIFIER and thus wins. Rule of thumb: More specific lexer rules first. Don't create new lexer tokens implicitly in parser rules. If you check the token type, you'll get a clue what's goi

Categories : Ant

antlr - loop through nodes
Let's say your grammar looks like this: grammar F; eq : 'eq' '(' property ',' value ')'; and : 'and' '(' filter ',' filter (',' filter)* ')'; filter : eq | and; property : 'name' | 'location'; value : 'john' | 'usa'; then you could extend the generated FBaseListener and override its enterAnd to get to the FilterContexts: public class Main { public static void main(String[

Categories : Ant

Antlr4 grammar ambiguity for two same prefixed rules
'sum' and 'avg' will always be tokenized as FUNCTIONID, there's no way around it. For an explanation, see: Antlr v3 error with parser/lexer rules You can do something like this: aggFunctionExpr : aggFunctionId '(' expr ')' 'over' ... ; functionExpr : functionId '(' expr ')' ; functionId : SUM | AVG; aggFunctionId : SUM | AVG; SUM : 'sum'; AVG : 'avg'; ...

Categories : Ant

Invoke ant target from another target with
There are some binding objects in the <groovy> scope (see the documentation for more details), more specifically there is ant object which is an instance of AntBuilder (see the api here), with this object you can invoke getProject() method to get an instance of org.apache.tools.ant.Project and with this Project you can use executeTarget(java.lang.String targetName) method to execute a differ

Categories : Ant

How to add dependency to ANT project
First of all ANT is older than Maven and therefore does not include core support for dependency management. Adding ivy Ivy is a dependency management framework for ANT http://ant.apache.org/ivy/ To enable it you need to do two things. First include the ivy task namespace to the top of your build file: <project .... xmlns:ivy="antlib:org.apache.ivy.ant"> A secondly you'll need to inst

Categories : Ant

Write a foreach for putting pathelements inside classpath element
Would be a lot simpler to use a fileset to populate your paths: <path id="compile.path"> <fileset dir="lib" includes="*.jar"/> </path> And use this in your build as a classpath reference: <javac ... classpathref="compile.path"/>

Categories : Ant

ANTLR4 - multiple code blocks in lexer rule
This functionality is [supposed to be] available starting with ANTLR 4.2.1. If it is not working, you should file an issue for the project.

Categories : Ant

error in ant sonar build
Check the stacktrace carefully. The first message: Caused by: org.sonar.squid.api.AnalysisException: Sonar is unable to analyze fil e : 'D:KhushbooRepositoryVOICE_BR_CDV_GATEWAY-1406_VoiceGateway-1406appVoi ceGatewayServiceServiceImplsrcmainjavacomcomcastusagecemputilsDebugHandler.java' Is explained by the second: Caused by: org.sonar.squid.api.AnalysisException: The source directo

Categories : Ant

How to use ant expandproperties with windows pathseparator
With ant you can use a forward slash / as the path separator when defining paths, even on Windows: C:/projects/trunk/build.xml If ${ant.file} returns the path using backslashes, convert this path first before you load the properties file. Unfortunately I haven't yet found the definitive way to convert paths from C:apath to C:/a/path and back. Supposedly pathconvert can do the trick... <pathc

Categories : Ant

OutOfMemoryError with ant.wsimport in gradle
It seems ant gets executed inside the Gradle JVM. So the best way to control memory settings for the Gradle JVM is via org.gradle.jvmargs=... in gradle.properties. org.gradle.jvmargs=-XX:MaxPermSize=512M

Categories : Ant

ANTLR lexer action pushing infos to parser?
Communication from lexer to parser is not possible in a way you want (if I understand you correctly). What you could do is put your LINE_DIRECTIVE on another channel (and not skip the token!). There are the DEFAULT (or DEFAULT_CHANNEL) and HIDDEN channels, and you can introduce more of them 1. The parser only reads tokens from the DEFAULT channel, but you can change that at runtime 2. 1 https://

Categories : Ant

Remove last three character from ant property
Example build: [echo] x = abcdefghijklmn [echo] y = abcdefghijk build.xml <project name="demo" default="build"> <property name="x" value="abcdefghijklmn"/> <target name="build"> <script language="javascript"> project.setProperty("y", project.getProperty("x").substr(0,11)); </script> <echo message="x = ${x}"/> <echo m

Categories : Ant




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.