diff options
author | Luca Falavigna <dktrkranz@debian.org> | 2014-04-26 15:11:58 +0200 |
---|---|---|
committer | Luca Falavigna <dktrkranz@debian.org> | 2014-04-26 15:11:58 +0200 |
commit | a3a0ab66f0da855e75e3a0e2acfb8aa106b46510 (patch) | |
tree | 5352edff1387c3d7e5a8b49ec56524f085c22782 /doc/user/java.xml | |
parent | 51fa4e4acb6fc8fc7a2af0fbdc21fd1e8feddb3a (diff) | |
parent | 140d836e9cd54fb67b969fd82ef7ed19ba574d40 (diff) |
Merge tag 'upstream/2.3.1'
Upstream version 2.3.1
Diffstat (limited to 'doc/user/java.xml')
-rw-r--r-- | doc/user/java.xml | 431 |
1 files changed, 339 insertions, 92 deletions
diff --git a/doc/user/java.xml b/doc/user/java.xml index 5827eec..95b20d2 100644 --- a/doc/user/java.xml +++ b/doc/user/java.xml @@ -1,6 +1,27 @@ +<?xml version='1.0'?> +<!DOCTYPE sconsdoc [ + <!ENTITY % scons SYSTEM "../scons.mod"> + %scons; + + <!ENTITY % builders-mod SYSTEM "../generated/builders.mod"> + %builders-mod; + <!ENTITY % functions-mod SYSTEM "../generated/functions.mod"> + %functions-mod; + <!ENTITY % tools-mod SYSTEM "../generated/tools.mod"> + %tools-mod; + <!ENTITY % variables-mod SYSTEM "../generated/variables.mod"> + %variables-mod; +]> + +<chapter id="chap-java" + xmlns="http://www.scons.org/dbxsd/v1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0/scons.xsd scons.xsd"> +<title>Java Builds</title> + <!-- - Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation + Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -57,9 +78,38 @@ </para> - <programlisting> - Java('classes', 'src') - </programlisting> + <scons_example name="java_java"> + <file name="SConstruct" printme="1"> +Java('classes', 'src') + </file> + <file name="src/Example1.java"> +public class Example1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + <file name="src/Example2.java"> +public class Example2 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + <file name="src/Example3.java"> +public class Example3 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + </scons_example> <para> @@ -69,10 +119,9 @@ </para> - <screen> - % <userinput>scons -Q</userinput> - javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java - </screen> + <scons_output example="java_java" suffix="1"> + <scons_output_command>scons -Q</scons_output_command> + </scons_output> <para> @@ -104,9 +153,54 @@ </para> - <programlisting> - Java('classes', 'src') - </programlisting> + <scons_example name="java_java-classes"> + <file name="SConstruct" printme="1"> +Java('classes', 'src') + </file> + <file name="src/Example1.java"> +public class Example1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} +public class AdditionalClass1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + <file name="src/Example2.java"> +public class Example2 +{ + class Inner2 { + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } + } +} + </file> + <file name="src/Example3.java"> +public class Example3 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} +public class AdditionalClass3 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + </scons_example> <para> @@ -117,12 +211,10 @@ </para> - <screen> - % <userinput>scons -Q</userinput> - javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java - % <userinput>scons -Q classes</userinput> - scons: `classes' is up to date. - </screen> + <scons_output example="java_java-classes" suffix="1"> + <scons_output_command>scons -Q</scons_output_command> + <scons_output_command>scons -Q classes</scons_output_command> + </scons_output> <para> @@ -143,17 +235,10 @@ </para> - <screen> - % <userinput>scons -Q</userinput> - javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java - % <userinput>scons -Q -c classes</userinput> - Removed classes/Example1.class - Removed classes/AdditionalClass1.class - Removed classes/Example2$Inner2.class - Removed classes/Example2.class - Removed classes/Example3.class - Removed classes/AdditionalClass3.class - </screen> + <scons_output example="java_java-classes" suffix="2"> + <scons_output_command>scons -Q</scons_output_command> + <scons_output_command>scons -Q -c classes</scons_output_command> + </scons_output> <para> @@ -167,9 +252,9 @@ </para> - <programlisting> - Java('classes', 'src', JAVAVERSION='1.6') - </programlisting> + <sconstruct> +Java('classes', 'src', JAVAVERSION='1.6') + </sconstruct> <para> See <varname>JAVAVERSION</varname> in the man page for more information. @@ -193,10 +278,39 @@ </para> - <programlisting> - Java(target = 'classes', source = 'src') - Jar(target = 'test.jar', source = 'classes') - </programlisting> + <scons_example name="java_jar1"> + <file name="SConstruct" printme="1"> +Java(target = 'classes', source = 'src') +Jar(target = 'test.jar', source = 'classes') + </file> + <file name="src/Example1.java"> +public class Example1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + <file name="src/Example2.java"> +public class Example2 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + <file name="src/Example3.java"> +public class Example3 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + </scons_example> <para> @@ -207,11 +321,9 @@ </para> - <screen> - % <userinput>scons -Q</userinput> - javac -d classes -sourcepath src src/Example1.java src/Example2.java src/Example3.java - jar cf test.jar classes - </screen> + <scons_output example="java_jar1" suffix="1"> + <scons_output_command>scons -Q</scons_output_command> + </scons_output> <para> @@ -230,12 +342,50 @@ </para> - <programlisting> - prog1_class_files = Java(target = 'classes', source = 'prog1') - prog2_class_files = Java(target = 'classes', source = 'prog2') - Jar(target = 'prog1.jar', source = prog1_class_files) - Jar(target = 'prog2.jar', source = prog2_class_files) - </programlisting> + <scons_example name="java_jar2"> + <file name="SConstruct" printme="1"> +prog1_class_files = Java(target = 'classes', source = 'prog1') +prog2_class_files = Java(target = 'classes', source = 'prog2') +Jar(target = 'prog1.jar', source = prog1_class_files) +Jar(target = 'prog2.jar', source = prog2_class_files) + </file> + <file name="prog1/Example1.java"> +public class Example1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + <file name="prog1/Example2.java"> +public class Example2 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + <file name="prog2/Example3.java"> +public class Example3 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + <file name="prog2/Example4.java"> +public class Example4 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} + </file> + </scons_example> <para> @@ -247,13 +397,9 @@ </para> - <screen> - % <userinput>scons -Q</userinput> - javac -d classes -sourcepath prog1 prog1/Example1.java prog1/Example2.java - javac -d classes -sourcepath prog2 prog2/Example3.java prog2/Example4.java - jar cf prog1.jar -C classes Example1.class -C classes Example2.class - jar cf prog2.jar -C classes Example3.class -C classes Example4.class - </screen> + <scons_output example="java_jar2" suffix="1"> + <scons_output_command>scons -Q</scons_output_command> + </scons_output> </section> @@ -270,10 +416,39 @@ </para> - <programlisting> - classes = Java(target = 'classes', source = 'src/pkg/sub') - JavaH(target = 'native', source = classes) - </programlisting> + <scons_example name="java_javah"> + <file name="SConstruct" printme="1"> +classes = Java(target = 'classes', source = 'src/pkg/sub') +JavaH(target = 'native', source = classes) + </file> + <file name="src/pkg/sub/Example1.java"> +package pkg.sub; +public class Example1 +{ + public static void main(String[] args) + { + } +} + </file> + <file name="src/pkg/sub/Example2.java"> +package pkg.sub; +public class Example2 +{ + public static void main(String[] args) + { + } +} + </file> + <file name="src/pkg/sub/Example3.java"> +package pkg.sub; +public class Example3 +{ + public static void main(String[] args) + { + } +} + </file> + </scons_example> <para> @@ -287,11 +462,9 @@ </para> - <screen> - % <userinput>scons -Q</userinput> - javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java - javah -d native -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3 - </screen> + <scons_output example="java_javah" suffix="1"> + <scons_output_command>scons -Q</scons_output_command> + </scons_output> <para> @@ -327,13 +500,42 @@ </para> - <programlisting> - Java(target = 'classes', source = 'src/pkg/sub') - class_file_list = ['classes/pkg/sub/Example1.class', - 'classes/pkg/sub/Example2.class', - 'classes/pkg/sub/Example3.class'] - JavaH(target = 'native', source = class_file_list, JAVACLASSDIR = 'classes') - </programlisting> + <scons_example name="java_JAVACLASSDIR"> + <file name="SConstruct" printme="1"> +Java(target = 'classes', source = 'src/pkg/sub') +class_file_list = ['classes/pkg/sub/Example1.class', + 'classes/pkg/sub/Example2.class', + 'classes/pkg/sub/Example3.class'] +JavaH(target = 'native', source = class_file_list, JAVACLASSDIR = 'classes') + </file> + <file name="src/pkg/sub/Example1.java"> +package pkg.sub; +public class Example1 +{ + public static void main(String[] args) + { + } +} + </file> + <file name="src/pkg/sub/Example2.java"> +package pkg.sub; +public class Example2 +{ + public static void main(String[] args) + { + } +} + </file> + <file name="src/pkg/sub/Example3.java"> +package pkg.sub; +public class Example3 +{ + public static void main(String[] args) + { + } +} + </file> + </scons_example> <para> @@ -343,11 +545,9 @@ </para> - <screen> - % <userinput>scons -Q</userinput> - javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java - javah -d native -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3 - </screen> + <scons_output example="java_JAVACLASSDIR" suffix="1"> + <scons_output_command>scons -Q</scons_output_command> + </scons_output> <para> @@ -358,10 +558,39 @@ </para> - <programlisting> - classes = Java(target = 'classes', source = 'src/pkg/sub') - JavaH(target = File('native.h'), source = classes) - </programlisting> + <scons_example name="java_javah_file"> + <file name="SConstruct" printme="1"> +classes = Java(target = 'classes', source = 'src/pkg/sub') +JavaH(target = File('native.h'), source = classes) + </file> + <file name="src/pkg/sub/Example1.java"> +package pkg.sub; +public class Example1 +{ + public static void main(String[] args) + { + } +} + </file> + <file name="src/pkg/sub/Example2.java"> +package pkg.sub; +public class Example2 +{ + public static void main(String[] args) + { + } +} + </file> + <file name="src/pkg/sub/Example3.java"> +package pkg.sub; +public class Example3 +{ + public static void main(String[] args) + { + } +} + </file> + </scons_example> <para> @@ -376,11 +605,9 @@ </para> - <screen> - % <userinput>scons -Q</userinput> - javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java src/pkg/sub/Example3.java - javah -o native.h -classpath classes pkg.sub.Example1 pkg.sub.Example2 pkg.sub.Example3 - </screen> + <scons_output example="java_javah_file" suffix="1"> + <scons_output_command>scons -Q</scons_output_command> + </scons_output> </section> @@ -400,10 +627,30 @@ </para> - <programlisting> - classes = Java(target = 'classes', source = 'src/pkg/sub') - RMIC(target = 'outdir', source = classes) - </programlisting> + <scons_example name="java_RMIC"> + <file name="SConstruct" printme="1"> +classes = Java(target = 'classes', source = 'src/pkg/sub') +RMIC(target = 'outdir', source = classes) + </file> + <file name="src/pkg/sub/Example1.java"> +package pkg.sub; +public class Example1 +{ + public static void main(String[] args) + { + } +} + </file> + <file name="src/pkg/sub/Example2.java"> +package pkg.sub; +public class Example2 +{ + public static void main(String[] args) + { + } +} + </file> + </scons_example> <para> @@ -414,11 +661,9 @@ </para> - <screen> - % <userinput>scons -Q</userinput> - javac -d classes -sourcepath src/pkg/sub src/pkg/sub/Example1.java src/pkg/sub/Example2.java - rmic -d outdir -classpath classes pkg.sub.Example1 pkg.sub.Example2 - </screen> + <scons_output example="java_RMIC" suffix="1"> + <scons_output_command>scons -Q</scons_output_command> + </scons_output> <para> @@ -431,3 +676,5 @@ </para> </section> + +</chapter> |