Thursday, June 4, 2009

Alfresco SDK build

更多精彩请到 http://www.139ya.com

1. get the source code from http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco by svn (download from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100, note : the command "svn.exe" is needed)

2. Check out the source from the appropriate SVN repository, as mentioned earlier.

3. Set the TOMCAT_HOME environment variable to the root of your Apache Tomcat install directory.

4. Navigate to the root of the source directory, then run the default Ant target: ant build.xml

5. It will take a few minutes to build everything. When it is done, run the distribute task like this:
ant -f continuous.xml distribute

Note: this step will failed due to the ALF-BINARIES not complete, but it does needed because will build out some lib (such as "/root/projects/web-service-client/build/dist/alfresco-web-service-client-3.2_Preview2.jar") for the next SDK build

6. It will take a few minutes to build everything. When it is done, run the distribute task like this:
ant -f continuous.xml distribute-sdk

7. The generated sdk can be found under "${alfresco_source}\build\dist\", the name is something like "alfresco-labs-sdk-*.tar.gz" or "alfresco-labs-sdk-*.zip", e.g. "alfresco-labs-sdk-3.2_Preview2.zip"

8. Unzip the sdk archive above into somewhere, e.g. "d:\\dev\\alfresco-sdk"

9. In eclipse, select File|Import|Existing Projects into Workspace. For the root directory, specify the directory where the SDK was uncompressed, e.g. "d:\\dev\\alfresco-sdk"

10. Select all of the projects that are listed and click Import.

11. Done! we will see a lot of projects are imported into eclipse, the project name is just like "SDK *", e.g. "SDK AlfrescoEmbedded"

Note: the step 5, on the reference book "alfresco_developer_guider.pdf", it suggests to use the command "ant -f continuous.xml distribute", but it will cause many errors during build, and because we just need alfresco sdk, so we just use "ant -f continuous.xml distribute-sdk" !!!

No comments: