Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8771421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:46:59+00:00 2026-06-13T17:46:59+00:00

I want to enable automatic Javadoc generation for a library project on each build.

  • 0

I want to enable automatic Javadoc generation for a library project on each build. I have 3 issues to tackle:

  1. How to integrate such an automated script in IDE’s build process ? (Eclipse and IDEA).

  2. How do I exclude the auto-generated R and Build classes from docs
    processing, as they are always generated under the source’s
    namespace.

  3. Pack and place Javadoc as a jar next to the build jar file.

The question is a bit broad, But I’m sure a good consolidated answer in one place will save the trouble for many.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:47:01+00:00Added an answer on June 13, 2026 at 5:47 pm

    Two ways:

    • Use Maven : Maven is great, and has android build support too. But still with default android structure, everything doesn’t works as effortlessly as default Ant builds. I hope in future Google introduces Maven structure.
    • Good old Apache Ant: the default ant build file lies in sdk_path/tools/ant/build.xml, this is imported into project’s build xml. Hence custom targets can be added for some additional work. Best place to put them is in a custom_rules.xml file at project root and import in project’s build.xml.

    custom_rules.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <project name="MyProject" default="help">
    
        <!-- IDE produces default jar as: out/production/classes.jar ,
        so we define a custom target to rename the jar, generate and package docs jar along
        with it  -->
        <target name="package_library" depends="init_pack_lib, check_lib_jar,   rename_lib_jar,generate_javadoc"/>
    
        <!-- init all properties to use-->
        <target name="init_pack_lib">
            <property name="real.out.dir" value="${basedir}/out/production"/>
            <property name="lib.gen.jar.file" value="${real.out.dir}/classes.jar"/>
            <property name="docs.dir" value="${real.out.dir}/Docs"/>
    
            <!-- we need to peek into manifest xml file-->
            <xmlproperty file="${manifest.abs.file}" collapseattributes="true"/>
            <property name="app.package" value="${manifest.package}"/>
            <property name="app.dist.name" value="${ant.project.name}_${manifest.android:versionName}"/>
            <property name="doc.package.names" value="${app.package}.*"/>
        </target>
    
        <!-- is classes.jar generated ?-->
        <target name="check_lib_jar">
            <available file="${lib.gen.jar.file}" property="lib.jar.found"/>
        </target>
    
        <!-- if so, give it a better name-->
        <target name="rename_lib_jar" if="${lib.jar.found}">
            <move file="${lib.gen.jar.file}"
                  tofile="${real.out.dir}/${app.dist.name}.jar"/>
        </target>
    
        <!-- generate and package JavaDoc for project-->
        <target name="generate_javadoc" depends="check_doc_dir, create_doc_dir, clean_docs_dir">
            <javadoc packagenames="${doc.package.names}"
                     sourcepath="${source.absolute.dir}"
                     destdir="${docs.dir}"
                     verbose="false"
                    />
            <jar compress="${jar.compress}" basedir="${docs.dir}" jarfile="${real.out.dir}/${app.dist.name}_JavaDoc.jar"/>
        </target>
    
        <!-- what about JavaDocs destination directory ? -->
        <target name="check_doc_dir">
            <condition property="docs.dir.not.exists">
                <not>
                    <available type="dir" file="${docs.dir}" property="docs.dir.exists"/>
                </not>
            </condition>
        </target>
    
        <!-- make docs directory if it isn't there already-->
        <target name="create_doc_dir" if="docs.dir.not.exists">
            <mkdir dir="${docs.dir}"/>
        </target>
    
        <!-- wipe previous JavaDocs files-->
        <target name="clean_docs_dir" if="docs.dir.exists">
            <delete includeemptydirs="true">
                <fileset dir="${docs.dir}" includes="**/*"/>
            </delete>
        </target>
    </project>
    

    To create package, simply run ant package_library from project root. You can include these in a build target so, they run on every build.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to enable all disabled commands in Emacs such as downcase-region - that
i have a small form. I want enable submit button when all the all
Using Xcode 4.2, how can one enable/disable Automatic Reference Counting? ANSWERED Under Build Settings,
I want enable user to select a photo from a photo library on his
I am implementing Code-First Migrations on my project and want to not have to
I want to enable the user to log in on a http page with
I want to enable auto update script in flex3. i am using below code
I want to enable the users of my website to download the files from
I want to enable the user to select a video file from the on-device
I want to enable only two columns in the DataGridview to be able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.