ant

How replace variable names in an xml-file?

巧了我就是萌 提交于 2019-12-18 07:19:45
问题 The java build tool ant provides filter to replace variables by their values Example: A file with properties: db.user.name=user db.driver=com.informix.jdbc.IfxDriver A XML file with generic settings (Note the @variables@ ) <driver-class>@db.driver@</driver-class> <user-name>@db.user.name@</user-name> becomes after coping using the filter <driver-class>com.informix.jdbc.IfxDriver</driver-class> <user-name>user</user-name> How can this functionallity be achieved with bash and plain unix tools?

How to create a gitlab project from terminal or command line

时光毁灭记忆、已成空白 提交于 2019-12-18 07:04:40
问题 I have internal setup gitlab server. I want to run separate ant script and create a project in that gitlab server. (without creating new project in gitlab UI) In the ant i can use exec executable and run the bash commands. And also how to send the Visibility Level and other parameters to gitlab server to create the project? 回答1: Would would need to use the GitLab API to create a project POST /projects One of the optional parameters is: visibility_level (optional): 0 is Private (Project access

How to set system property values in NetBeans?

北城余情 提交于 2019-12-18 06:47:11
问题 I 'm following a tutorial about JAAS Authentication here and when it shows how to run the example code, says that the compiled class should be launched with a standard option of Java launcher which is -Djava.security.auth.login.config==sample_jaas.config . In this way a system property will be set: java -Djava.security.auth.login.config==sample_jaas.config sample.SampleAcn I did it with this way, but now I want to run the code in NetBeans too. Since NetBeans use Ant I think specifying these

Is it possible to specify logger for ant inside build.xml?

白昼怎懂夜的黑 提交于 2019-12-18 05:57:45
问题 Is it possible specify Ant listener/logger inside build.xml , not on a command line? 回答1: Within the buildfile it's possible to make use of the ant api and create an internal task via scriptdef . i.e. implemented with groovy: http://josefbetancourt.wordpress.com/2011/08/18/buildlistener-groovy-scriptdef/ http://octodecillion.com/blog/buildlistener-groovy-scriptdef/ It's also possible to adjust the loglevel inside the buildfile, see : https://stackoverflow.com/a/5464009/130683 https:/

Loading Properties File In JUnit @BeforeClass

▼魔方 西西 提交于 2019-12-18 05:45:17
问题 I'm trying to load sample.properties from my classpath during my JUnit test execution and it can't find the file in the class path. If I write a Java Main class I'm able to load the file just fine. I'm using the below ant task to execute my JUnit. public class Testing { @BeforeClass public static void setUpBeforeClass() throws Exception { Properties props = new Properties(); InputStream fileIn = props_.getClass().getResourceAsStream("/sample.properties"); **props.load(fileIn);** } } JUnit:

How to pass arguments to aapt when building android apk?

这一生的挚爱 提交于 2019-12-18 05:08:26
问题 I'm building an apk using ant on Linux (not using Eclipse), and I'm trying to find an easy way to switch between compressing assets and not, in order to keep my huge database uncompressed for < 2.3. As per this article: http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/ I see that it's possible to do this by specifying something like aapt -0 db , but I can't find information on how to edit the way ant interacts with aapt. Or do I have to run aapt by itself?

Override the compiler attribute in an Ant javac task

我只是一个虾纸丫 提交于 2019-12-18 04:54:09
问题 I'm trying to override Ant compiler attributes via the command line so that all 'javac' tasks use my specified compiler. The problem I've run into is that any target that sets its own value for compiler overrides the one that I set at the commmand line. So, even though I'm entering the following command. ant -Dbuild.compiler=mycompiler Any target that has the following is going to use the modern compiler instead of mycompiler because of that compiler="modern" attribute <javac srcdir="."

Simulating the Maven2 filter mechanism using Ant

一曲冷凌霜 提交于 2019-12-18 04:19:10
问题 I have a properties file, let say my-file.properties. In addition to that, I have several configuration files for my application where some information must be filled regarding the content of my-file.properties file. my-file.properties: application.version=1.0 application.build=42 user.name=foo user.password=bar Thus, in my configuration files, I will find some ${application.version} , ${user.name} that will be replaced by their value taken in the properties file... When I build my

Apache ant manifest class-path?

霸气de小男生 提交于 2019-12-18 04:07:38
问题 I have a standard project layout for a java project: project / src / source_file_1.java ... source_file_N.java build / classes / source_file_X.class ... jar / MyJar.jar lib / SomeLibrary.jar SomeOtherLibrary.jar As far as I can tell, I am building the project correctly with Ant. I need to set the class-path attribute in the Manifest file so my classes can use the required libraries. The following relevant information from build.xml <target name="compile" depends="init"> <javac srcdir="src"

referencing ant script location from within ant file

a 夏天 提交于 2019-12-18 03:34:23
问题 I have a utility build script that gets called from a variety of project-specific build scripts on a build server. Everything works fine, until the relative directory structure changes. That is: trunk/ utilities/ imported.xml some_resource_file projectName/ importing.xml works just fine, but sometimes we need: trunk/ importing.xml utilities/ imported.xml some_resource_file projectName/ The problem is that imported.xml needs some_resource_file and currently gets to it by referring to ..