JaroslavTulach: /* Usage */ - 2014-10-30 20:50:37

Usage

←Older revision Revision as of 20:50, 30 October 2014
Line 26: Line 26:
It is always better to build the root project:
It is always better to build the root project:
<source lang="bash">
<source lang="bash">
-
$ cd samples
+
$ cd samples # in case of [[Mercurial]] checkout
$ ant build.xml # or from the IDE
$ ant build.xml # or from the IDE
</source>
</source>
before opening its sub-projects in the IDE. Failing to do so may cause the projects to show ''broken references'' (due to missing [[libraries]] that need to be downloaded first in the [[Mercurial]] case). Btw. in case you need to perform really clean build and download all [[libraries]] once again, you can
before opening its sub-projects in the IDE. Failing to do so may cause the projects to show ''broken references'' (due to missing [[libraries]] that need to be downloaded first in the [[Mercurial]] case). Btw. in case you need to perform really clean build and download all [[libraries]] once again, you can
<source lang="bash">
<source lang="bash">
-
$ cd samples
+
$ cd samples # in case of [[Mercurial]] checkout
$ rm -r libs/dist
$ rm -r libs/dist
</source>
</source>

JaroslavTulach: /* Usage */ - 2014-10-30 20:47:14

Usage

←Older revision Revision as of 20:47, 30 October 2014
Line 26: Line 26:
It is always better to build the root project:
It is always better to build the root project:
<source lang="bash">
<source lang="bash">
 +
$ cd samples
$ ant build.xml # or from the IDE
$ ant build.xml # or from the IDE
</source>
</source>
-
before opening its sub-projects in the IDE. Failing to do so may cause the projects to show ''broken references'' (due to missing [[libraries]] that need to be downloaded first in the [[Mercurial]] case).
+
before opening its sub-projects in the IDE. Failing to do so may cause the projects to show ''broken references'' (due to missing [[libraries]] that need to be downloaded first in the [[Mercurial]] case). Btw. in case you need to perform really clean build and download all [[libraries]] once again, you can
 +
<source lang="bash">
 +
$ cd samples
 +
$ rm -r libs/dist
 +
</source>
=== Funny Stories ===
=== Funny Stories ===

JaroslavTulach: /* Environment */ - 2014-10-30 20:45:41

Environment

←Older revision Revision as of 20:45, 30 October 2014
Line 11: Line 11:
In order to use the sample [[sources]] you may need:
In order to use the sample [[sources]] you may need:
-
* At least [[JDK]] 1.6.0 - necessary for compilation and execution
+
* At least [[JDK]]7 or [[JDK]8 - necessary for compilation and execution
* At least [[Ant]] 1.8.1 - allows simple compilation and execution from command line
* At least [[Ant]] 1.8.1 - allows simple compilation and execution from command line
* At least [[NetBeans]] IDE 6.9 - all projects are configured to smoothly open in [[NetBeans]] IDE
* At least [[NetBeans]] IDE 6.9 - all projects are configured to smoothly open in [[NetBeans]] IDE

JaroslavTulach: /* Usage */ - 2014-08-08 11:14:18

Usage

←Older revision Revision as of 11:14, 8 August 2014
Line 24: Line 24:
=== Usage ===
=== Usage ===
-
You need to build the root project:
+
It is always better to build the root project:
<source lang="bash">
<source lang="bash">
$ ant build.xml # or from the IDE
$ ant build.xml # or from the IDE
</source>
</source>
-
before opening its sub-projects in the IDE. Failing to do so may cause the projects to show ''broken references'' (due to missing [[libraries]] that need to be downloaded first).
+
before opening its sub-projects in the IDE. Failing to do so may cause the projects to show ''broken references'' (due to missing [[libraries]] that need to be downloaded first in the [[Mercurial]] case).
 +
 
 +
=== Funny Stories ===
 +
 
 +
My [[Hudson]] server crashed in early months of 2014. I had to configure it from scratch. While doing so, I forgot to configure the job to produce ''apidesign.zip'' file with [[sources]]. Has anyone noticed? Nobody sent me an email! Just yesterday Jáchym, my co-worker, who I torture by forcing him to read [[TheAPIBook]] and become [[good]] [[API]] designer, stopped in my office and timidly asked: ''Where can I get the sources? There is no [[ZIP]] file!''
 +
 
 +
For a while I tried to blame him for not using [[Mercurial]], but after a while I realized the problem is on my side. As a result, the [http://hudson.apidesign.org/job/samples/ zip file with sources] is back as of Aug 8, 2014. Will anyone use them? It would be nice as reading [[TheAPIBook|Practical API Design]] book without having whole [[sources]] at your hand is like trying to understand [[Swing]] just by reading its [[Javadoc]].
 +
 
 +
Let me know (Jáchym, you have to) whether you found the [[sources]] useful.
 +
 
 +
<comments/>

JaroslavTulach at 11:03, 8 August 2014 - 2014-08-08 11:03:42

←Older revision Revision as of 11:03, 8 August 2014
Line 2: Line 2:
are extracted from real projects. As such it is guaranteed they are correct, they compile and can even be executed, [[debugger|debugged]] and tested.
are extracted from real projects. As such it is guaranteed they are correct, they compile and can even be executed, [[debugger|debugged]] and tested.
-
Moreover, as it is often not enough to see just a few lines of code in middle of a page, readers are recommended to get the whole tree of [[sources]], including their history and play with them for real. Preferably use [[Mercurial]] to clone the [[sources]] [[Hg]] [http://source.apidesign.org/hg/apidesign/ repository]:
+
Moreover, it is often not enough to see just a few lines of code in middle of a page, readers are recommended to get the whole tree of [[sources]], including their history and play with them for real. Preferably use [[Mercurial]] to clone the [[sources]] [[Hg]] [http://source.apidesign.org/hg/apidesign/ repository]:
<source lang="bash">
<source lang="bash">

JaroslavTulach: /* Download */ - 2014-08-08 11:03:07

Download

←Older revision Revision as of 11:03, 8 August 2014
Line 19: Line 19:
=== Download ===
=== Download ===
-
Those that prefer [[ZIP]] over [[Mercurial]] (which [[I]] don't understand) can download the latest published build from our
+
Those that prefer [[ZIP]] over [[Mercurial]] (for example to get also all necessary libraries with the [[sources]]) can download the latest published build from our
-
[http://hudson.apidesign.org/job/samples continuous build server]. Download the latest version of apidesign-XYZ.zip, unzip it on your local computer. Start [[NetBeans]] IDE and open individual projects as needed.
+
[http://hudson.apidesign.org/job/samples continuous build server]. Download the latest version of apidesign.zip, unzip it on your local computer. Start [[NetBeans]] IDE and open individual projects as needed.
-
 
+
=== Usage ===
=== Usage ===

JaroslavTulach: /* Environment */ - 2014-08-06 11:29:34

Environment

←Older revision Revision as of 11:29, 6 August 2014
Line 10: Line 10:
=== Environment ===
=== Environment ===
-
In order to use the sample sources you may need:
+
In order to use the sample [[sources]] you may need:
* At least [[JDK]] 1.6.0 - necessary for compilation and execution
* At least [[JDK]] 1.6.0 - necessary for compilation and execution
* At least [[Ant]] 1.8.1 - allows simple compilation and execution from command line
* At least [[Ant]] 1.8.1 - allows simple compilation and execution from command line

JaroslavTulach at 11:28, 6 August 2014 - 2014-08-06 11:28:58

←Older revision Revision as of 11:28, 6 August 2014
Line 2: Line 2:
are extracted from real projects. As such it is guaranteed they are correct, they compile and can even be executed, [[debugger|debugged]] and tested.
are extracted from real projects. As such it is guaranteed they are correct, they compile and can even be executed, [[debugger|debugged]] and tested.
-
Moreover, as it is often not enough to see just few lines of code in middle of a page, readers are recommended to get the whole tree of [[sources]], including their history and play with them for real. Preferably use [[Mercurial]] to clone the [[sources]] [[Hg]] [http://source.apidesign.org/hg/apidesign/ repository]:
+
Moreover, as it is often not enough to see just a few lines of code in middle of a page, readers are recommended to get the whole tree of [[sources]], including their history and play with them for real. Preferably use [[Mercurial]] to clone the [[sources]] [[Hg]] [http://source.apidesign.org/hg/apidesign/ repository]:
<source lang="bash">
<source lang="bash">

JaroslavTulach: /* Usage */ - 2014-08-06 11:28:18

Usage

←Older revision Revision as of 11:28, 6 August 2014
Line 25: Line 25:
=== Usage ===
=== Usage ===
-
You need to run <tt>build.xml</tt> before opening the projects in the IDE. Otherwise the projects have unsolvable broken references (due to missing [[libraries]] that need to be downloaded).
+
You need to build the root project:
 +
<source lang="bash">
 +
$ ant build.xml # or from the IDE
 +
</source>
 +
before opening its sub-projects in the IDE. Failing to do so may cause the projects to show ''broken references'' (due to missing [[libraries]] that need to be downloaded first).

JaroslavTulach at 11:26, 6 August 2014 - 2014-08-06 11:26:54

←Older revision Revision as of 11:26, 6 August 2014
Line 1: Line 1:
-
The [[TheAPIBook|Practical API Design]] book comes with huge amount of additional [[sources]]. All of them, including their history, are available online. This page provides basic information for those who want to study them.
+
All the code snippets shown in the [[TheAPIBook|Practical API Design]] book
 +
are extracted from real projects. As such it is guaranteed they are correct, they compile and can even be executed, [[debugger|debugged]] and tested.
 +
 
 +
Moreover, as it is often not enough to see just few lines of code in middle of a page, readers are recommended to get the whole tree of [[sources]], including their history and play with them for real. Preferably use [[Mercurial]] to clone the [[sources]] [[Hg]] [http://source.apidesign.org/hg/apidesign/ repository]:
 +
 
 +
<source lang="bash">
 +
$ hg clone http://source.apidesign.org/hg/apidesign/
 +
</source>
=== Environment ===
=== Environment ===
In order to use the sample sources you may need:
In order to use the sample sources you may need:
-
* [[JDK]] 1.6.0 - necessary for compilation and execution
+
* At least [[JDK]] 1.6.0 - necessary for compilation and execution
-
* [[Ant]] 1.8.1 - allows simple compilation and execution from command line
+
* At least [[Ant]] 1.8.1 - allows simple compilation and execution from command line
-
* [[NetBeans]] IDE 6.9 - all projects are configured to smoothly open in [[NetBeans]] IDE
+
* At least [[NetBeans]] IDE 6.9 - all projects are configured to smoothly open in [[NetBeans]] IDE
 +
 
 +
If you managed to successfully start [[NetBeans]] IDE, you probably have everything necessary installed on your computer.
=== Download ===
=== Download ===
-
The sources for sample examples are processed, verified and published daily on API Design [http://hudson.apidesign.org/job/samples continuous build server]. Download the latest version of apidesign-XYZ.zip, unzip it on your local computer. Start [[NetBeans]] IDE and open individual projects as needed. History of all the modifications can be found in our [[Mercurial]] [http://source.apidesign.org/hg/apidesign/ repository]. To obtain them use:
+
Those that prefer [[ZIP]] over [[Mercurial]] (which [[I]] don't understand) can download the latest published build from our
 +
[http://hudson.apidesign.org/job/samples continuous build server]. Download the latest version of apidesign-XYZ.zip, unzip it on your local computer. Start [[NetBeans]] IDE and open individual projects as needed.
-
<source lang="bash">
 
-
hg clone http://source.apidesign.org/hg/apidesign/
 
-
</source>
 
=== Usage ===
=== Usage ===
-
You need to run <tt>build.xml</tt> before opening the projects in the IDE. Otherwise the projects have unsolvable broken references.
+
You need to run <tt>build.xml</tt> before opening the projects in the IDE. Otherwise the projects have unsolvable broken references (due to missing [[libraries]] that need to be downloaded).
-
 
+
-
The build fails on JDK 1.5 because of <tt>ServiceLoader</tt> usages. This needs to be mentioned somewhere, and <tt>build.xml</tt> should perhaps skip that example when building on 1.5.
+