Ant insert line in file




















The easiest way is to add the following line to your build. The simplest way to use the ProGuard task in an Ant build file is to keep your ProGuard configuration file, and include it from Ant. You can include your ProGuard configuration file by setting the configuration attribute of your proguard task. Your ant build file will then look like this:. This is a convenient option if you prefer ProGuard's configuration style over XML, if you want to keep your build file small, or if you have to share your configuration with developers who don't use Ant.

Instead of keeping an external ProGuard configuration file, you can also copy the contents of the file into the nested text of the proguard task the PCDATA area. Your Ant build file will then look like this:. Firstly, the character cannot be used for comments in an XML file. All occurrences of the character can be removed. The resulting configuration will be equivalent, but much more verbose and difficult to read, as XML goes. The remainder of this page presents the supported tags.

For a more extensive discussion of their meaning, please consult the traditional Usage section. The jar elements are path elements, so they can have any of the standard path attributes and nested elements.

The most common attributes are:. ProGuard Playground Allowing developers to share and collaborate on ProGuard and R8 configuration, by visualizing the impact of keep rules. This example will show you how to use Ant to compile and run a Java program,by using ant. Follow the steps mentioned below for this sample example. Create a directory and name it to antfirstexample in any of your local drive. Everything will go inside this directory like: source files, created output files, and the build file.

By convention, all Ant build files should be called build. If you're not familiar with XML syntax, I recommend you read up a little on it first, so you know what elements, attributes, tags, closing tags, and comments look like. It's very similar to HTML syntax. But more formal You know XML? Let's break this down line-by-line:. The graphical view of the XML Tree of the build file is given below.

The graphical view of the XML tree makes it easier to look at a build file, and so the structure of the build file should become more clear. At the top of the tree is a element, which has two attributes, name and default. All Ant build files must contain a single element as the root element.

It tells Ant the name of the project and, optionally, the default target. A target represents a single stage in the build process. A build file can have many targets, each of which must have a unique name. The following changes the my. Assume my. The slashes conform to the expectations of the Properties class.

The file will be stored in a manner so that each character is examined and escaped if necessary. The layout and comment of the original file is preserved. New properties are added at the end of the file. Existing properties are overwritten in place.



0コメント

  • 1000 / 1000