65535
65535

Reputation: 553

When adding a YGuard Target to an ANT build in NetBeans, exactly where in the build.xml file should the YGuard Ant Target be placed?

When adding YGuard Ant Target xml to build.xml in NetBeans, exactly where in the build.xml file should the YGuard Ant Target xml be placed?

Or, should the YGuard Ant Target xml be placed somewhere else?

I've placed the YGuard Ant Target xml in the build.xml file, but the out .jar, java_obf.jar, which is the obfuscated .jar, is not created when running Build.

Any help would be greatly appreciated.

Here is the YGuard Ant target:

<target  name="yguard">
        <taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" classpath="yguard.jar"/>
        <yguard>
            <inoutpair in="/Users/user/NetBeansProjects/Project/dist/java.jar" out="/Users/user/NetBeansProjects/Project/dist/java_obf.jar"/>
        </yguard>
    </target>

Upvotes: 1

Views: 494

Answers (1)

ePortfel
ePortfel

Reputation: 239

  1. Use -post-jar target so NetBeans will run obfuscation after generating jar
  2. Use javac.classpath placeholder but first add yGuard jars to project libraries
  3. Run rename subtask or yGuard would do nothing and will not inform you that the subtask is missing
    <target name="-post-jar">
        <taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" classpath="${javac.classpath}"/>
        <yguard>
            <inoutpair in="/Users/user/NetBeansProjects/Project/dist/java.jar" out="/Users/user/NetBeansProjects/Project/dist/java_obf.jar"/>
            <rename/>
        </yguard>
    </target>

Upvotes: 1

Related Questions