Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A9CA1200B17 for ; Tue, 21 Jun 2016 08:57:31 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A856E160A4F; Tue, 21 Jun 2016 06:57:31 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 78F70160A36 for ; Tue, 21 Jun 2016 08:57:30 +0200 (CEST) Received: (qmail 23777 invoked by uid 500); 21 Jun 2016 06:57:29 -0000 Mailing-List: contact commits-help@ace.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ace.apache.org Delivered-To: mailing list commits@ace.apache.org Received: (qmail 23766 invoked by uid 99); 21 Jun 2016 06:57:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2016 06:57:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 35A791A12AD for ; Tue, 21 Jun 2016 06:57:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.426 X-Spam-Level: X-Spam-Status: No, score=-0.426 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id A8kKgxepDau4 for ; Tue, 21 Jun 2016 06:57:24 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 8A7175F247 for ; Tue, 21 Jun 2016 06:57:23 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 81357E02E4 for ; Tue, 21 Jun 2016 06:57:22 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 2930B3A1A17 for ; Tue, 21 Jun 2016 06:57:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1749454 - /ace/site/trunk/content/docs/setup-dev-environment.mdtext Date: Tue, 21 Jun 2016 06:57:21 -0000 To: commits@ace.apache.org From: jawi@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160621065722.2930B3A1A17@svn01-us-west.apache.org> archived-at: Tue, 21 Jun 2016 06:57:31 -0000 Author: jawi Date: Tue Jun 21 06:57:21 2016 New Revision: 1749454 URL: http://svn.apache.org/viewvc?rev=1749454&view=rev Log: ACE-596 - further improvements. Modified: ace/site/trunk/content/docs/setup-dev-environment.mdtext Modified: ace/site/trunk/content/docs/setup-dev-environment.mdtext URL: http://svn.apache.org/viewvc/ace/site/trunk/content/docs/setup-dev-environment.mdtext?rev=1749454&r1=1749453&r2=1749454&view=diff ============================================================================== --- ace/site/trunk/content/docs/setup-dev-environment.mdtext (original) +++ ace/site/trunk/content/docs/setup-dev-environment.mdtext Tue Jun 21 06:57:21 2016 @@ -13,8 +13,8 @@ Point your browser to the [ACE download On that page you will find, amongst others, a link to the latest released sources, plus an archive containing all binary third-party dependencies. The page will automatically select -a download mirror close to you. Download *both* the source and dependencies archive and then -type: +a download mirror close to you. Download *both* the source and dependencies archive and +then type: :::sh $ unzip apache-ace-2.1.0-src.zip @@ -26,7 +26,8 @@ both archives. It is fine to overwriting ### Checkout from subversion -Alternatively, you can check out the sources directly from the main Apache source repositories: +Alternatively, you can check out the sources directly from the main Apache source +repositories: :::sh $ svn co http://svn.apache.org/repos/asf/ace/trunk apache-ace @@ -36,15 +37,16 @@ or :::sh $ git clone git://git.apache.org/ace apache-ace -In both cases you end up with a copy of the source code. +In both cases you end up with a copy of the source code. *Note: committers should always +use Subversion as the Git mirror is read-only.* ## Building the sources There are two ways to build the sources. You can either run a command line build or use -Eclipse with the [Bndtools plugin](http://bndtools.org/) to build everything. If you want to -actively start developing, we strongly recommend you use Eclipse with Bndtools as this is -by far the most convenient way to build and run Apache ACE. +Eclipse with the [Bndtools plugin](http://bndtools.org/) to build everything. If you want +to actively start developing, we strongly recommend you use Eclipse with Bndtools as this +is by far the most convenient way to build and run Apache ACE. ### Eclipse with Bndtools @@ -52,26 +54,30 @@ by far the most convenient way to build For developing ACE using Eclipse, you need: -* A recent Java JDK, at least [Java 8](http://www.oracle.com/technetwork/indexes/downloads/index.html); -* A recent Eclipse, for example, [Eclipse Mars](http://www.eclipse.org/downloads/) with the following plugins: - * [Subclipse](http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA); - * [BndTools](http://bndtools.org/installation.html); - * [TestNG](http://testng.org/doc/download.html). +* A recent Java JDK, at least [Java + 8](http://www.oracle.com/technetwork/indexes/downloads/index.html); +* A recent Eclipse, for example, [Eclipse Mars](http://www.eclipse.org/downloads/) with + the following plugins: + * [Subclipse](http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA); + * [BndTools](http://bndtools.org/installation.html); + * [TestNG](http://testng.org/doc/download.html). For building or exporting the compiled artifacts of ACE without Eclipse, you can use the Gradle wrapper script that is available in the source repository. #### Eclipse set up -When firing up Eclipse, make sure to either create a new workspace and check out the -sources according to the instructions below, or choose the root folder where you have -previously checked out or extracted your sources. This is important, as otherwise -Bndtools will not function correctly. +Start Eclipse with a new, empty, workspace. To set up the projects you can do either: + +1. if you use the *same* root folder/directory in which your ACE sources are checked out + (or extracted) as your Eclipse workspace, you can import the projects directly using + "File -> Import... -> General -> Existing Projects into Workspace"; +2. checkout the sources from Subversion as described below. ##### Checking out the latest sources -If you created a new workspace above, you need to grab the latest sources from ACE's -subversion repository. To do this, open up the "SVN Repository Exploring" perspective, and +If you created a new and empty workspace, you need to grab the latest sources from ACE's +Subversion repository. To do this, open up the "SVN Repository Exploring" perspective, and add the following URL as new SVN repository using the yellow add-icon in the "SVN Repositories" view: @@ -79,24 +85,16 @@ Repositories" view: After this, expand the newly created tree node named after the SVN URL, and select all **individual** projects underneath. *Note: do **not** (only) select the root node or the -files that reside underneath the root node, as this won't let you properly import the +files that reside underneath the root node, as this won't let you properly import the individual projects.* -Right click on the selected (sub)projects, and choose "Checkout…" from the context menu. +Right click on the selected (sub)projects, and choose "Checkout..." from the context menu. Leave all default settings as-is and click "finish". Now relax and wait until the checkout is completed, and all projects are imported into your workspace. Switching back to the "Bndtools" perspective should give you a long list of imported projects. -##### Importing existing projects - -If you created a workspace in a folder that already contained the sources, you need to -import these projects into the workspace. From the main menu in Eclipse, choose: "File --> Import..." and then select "General -> Existing projects into workspace..." and -select your workspace folder. A list of projects should show up now. Import them all, wait -until Eclipse has built the project and you're ready to start. - ##### Coding guidelines If you want to develop for ACE, you might want to import the code templates and formatter @@ -108,55 +106,77 @@ import it into Eclipse as your default f One of the benefits of the migration to BndTools is that we can now directly run ACE from Eclipse with almost zero effort. In fact, it is even possible to directly debug or profile ACE from Eclipse. By convention, all runnable projects start with "run-" and contain a -".bndrun" file. -To start a project, right-click the "bndrun" file and select "Run As" -> "Bnd OSGi Run +".bndrun" file. + +To start a project, right-click the "bndrun" file and select "Run As" -> "Bnd OSGi Run Launcher" or "Debug As" -> "Bnd OSGi Run Launcher". There are several projects that can be run which we outline in the next sections. -##### ACE target +##### run-develop + +This project allows you to directly start an ACE target that receives software from the +ACE server. By default, the target is started with a Gogo shell to allow you to interact +with it, making it easy to debug or troubleshoot it. *Note: since the Gogo bundles are +already installed, do **not** provision them using ACE! The deployment will fail.* + +To run or debug the ACE server, use the "develop.bndrun" file in the +"run-develop" project. + +##### run-target -This project allows you to directly start an ACE target that receives software from the ACE -server. By default, the target is started with a Gogo shell to allow you to interact with it. +This project allows you to directly start an ACE target that receives software from the +ACE server. In contrast to the "run-develop" project, this target does only start an ACE +management agent and nothing else. -To run or debug the ACE server, use the "target.bndrun" file in the -"run-target" project. +To run or debug the ACE server, use the "target.bndrun" file in the "run-target" +project. -##### ACE server +##### run-server -This project allows you to start a plain ACE server *without* an OBR and (web)client. -Its endpoints can be reached on port 8080. The server expects an OBR to be -available at the same host on port 8082. +This project allows you to start a plain ACE server *without* an OBR and (web)client. Its +endpoints can be reached on port 8080. The server expects an OBR to be available +at the same host on port 8082. -To run or debug the ACE server, use the "server.bndrun" file in the -"run-server" project. +To run or debug the ACE server, use the "server.bndrun" file in the "run-server" +project. -##### ACE OBR +##### run-obr -This will start an OBR for your artifacts. By default, its endpoints can be reached through -port 8082. +This will start an OBR for your artifacts. By default, its endpoints can be reached +through port 8082. -To run or debug the ACE OBR, use the "obr.bndrun" file in the "run-obr" +To run or debug the ACE OBR, use the "obr.bndrun" file in the "run-obr" project. + +##### run-client + +This project allows you to start the web-based client. The web UI can be reached by +opening [localhost:8081/](http://localhost:8081/) in your browser. The ACE client expects +a (plain) ACE server to be available on the same host through port 8080 and an +ACE OBR to be available on the same on port 8082. + +To run or debug the ACE client, use the "client.bndrun" file in the "run-client" project. -##### ACE client +##### run-server-allinone -This project allows you to start the web-based client. The web UI can be reached by opening -[localhost:8081/](http://localhost:8081/) in your browser. The ACE client expects a (plain) ACE -server to be available on the same host through port 8080 and an ACE OBR to be -available on the same on port 8082. +In case you just want to start everything in one go, you can use the "all-in-one" server. +This starts the ACE server, OBR and web-based client and allows you to reach all endpoints +through port 8080. -To run or debug the ACE client, use the "client.bndrun" file in the -"run-client" project. +To run or debug the "all in one" ACE server, use the "server-allinone.bndrun" +file in the "run-server-allinone" project. -##### ACE server-allinone +##### run-relay -In case you just want to start everything in one go, you can use the "all-in-one" server. This -starts the ACE server, OBR and web-based client and allows you to reach all endpoints through -port 8080. +This project allows you to start a relay server that you can use to distribute the load +from your main ACE server. Instead of all clients talking directly to one ACE server, you +can let clients talk to one or more relay servers. The default relay configuration expects +an ACE server to run at port 8080 and an OBR to run at port 8082. Its +endpoints are reacheable through port 8282. -To run or debug the "all in one" ACE server, use the -"server-allinone.bndrun" file in the "run-server-allinone" project. +To run or debug the relay server, use the "relay.bndrun" file in the "run-relay" +project. ##### Unit tests @@ -170,6 +190,7 @@ named with a '.itest' suffix. T framework up and running. To run one or all integration tests, use "Run As -> Bnd OSGi Test Launcher (JUnit)" or "Debug As -> Bnd OSGi Test Launcher (JUnit)". + ### Command line build The command line build for Apache ACE is based on [Gradle](http://gradle.org/). @@ -177,25 +198,34 @@ The command line build for Apache ACE is The build is structured as a flat hierarchy of projects, and you can go into any of these projects to build just that project and its dependencies. There are two special projects: -1. `cnf` -- Which is collection of repositories that contain all the required dependencies for building and running Apache ACE; -2. `build` -- A project that contains the necessary scripts and tools to do source and binary releases. +1. `cnf` -- Which is collection of repositories and configuration files that contain all + the required dependencies for building and running Apache ACE; +2. `build` -- A project that contains the necessary scripts and tools to do source and + binary releases. So, to build Apache ACE, we issue the following command: :::sh $ ./gradlew build -This will build everything, and run all unit and integration tests. In the end, this leaves us with -a set of bundles (in the generated folder of each individual project). +This will build everything, and run all unit and integration tests. In the end, this +leaves us with a set of bundles (in the generated folder of each individual +project). -The following targets are available: +The following targets are available (there actually are a few more, use the tasks +target for that, but these are the most important ones): -* clean -- Cleans up any files in the current project that were generated during a build; +* clean -- Cleans up any files and artifacts in the current projects that were + generated during a build; * build -- Build the current project; -* rat -- Run the release audit tool that reports any license violations, such as incompatible licenses or missing license headers; -* export -- Exports all "bndrun" files into runnable JAR files in generated/distributions/executable of each "runnable" project. - -There actually are a few more (use the tasks target for that), but these are the most important ones. +* rat -- Run the release audit tool that reports any license violations, such as + incompatible licenses or missing license headers; +* export -- Exports all "bndrun" files into runnable JAR files in + generated/distributions/executable of each "runnable" project. + +You can prefix these task names with the `:` to execute them for a single +project. For example, `run-target:export` would create the runnable JAR file for the +run-target project only. ## How to... @@ -203,30 +233,28 @@ There actually are a few more (use the < Unfortunately, the easy answer is "no". Until somebody ports Bndtools to your favorite IDE, you either have to use Eclipse, or a combination of your IDE and manual builds using -Ant (though not recommended). If you insist, please do make sure you manually generate the -proper metadata for Eclipse. +Gradle (though not recommended). ### ...build this thing in Eclipse? Normally, you don't. Seriously. If "Build Automatically" is enabled, as soon as you hit -save after changing a line of code, BndTools will automatically build your bundle for you. -In fact, if your server if already running, Bndtools will even redeploy all changed -bundles to it automatically. +save after changing a line of code, Bndtools will automatically build your bundle(s) for +you. In fact, if any project is already running, Bndtools will even redeploy all changed +bundles to it automatically allowing you to directly test your changes at runtime. ### ...get rid of all those red crosses in Eclipse? If Eclipse complaints about missing test libraries, you probably forgot to install the TestNG plugin. If this plugin is installed, it will automatically cause your projects to get the required dependency to the TestNG library. Without this plugin, Eclipse won't have -the required library and fails to compile the code correctly. -In case you are importing the projects into Eclipse for the first time, it takes a while -and a couple of builds to get rid of all build errors. If the problem does *not* go away, -please drop a line on the [mailing lists](/get-involved/mailing-lists.html) to get -additional help. +the required library and fails to compile the code correctly. In case you are importing +the projects into Eclipse for the first time, it takes a while and a couple of builds to +get rid of all build errors. If the problem does *not* go away, please drop a line on the +[mailing lists](/get-involved/mailing-lists.html) to get additional help. ### ...add an OSGi bundle -The easiest way to add an OSGi bundle, is to drag it onto the "Local Repository" entry in +The easiest way to add an OSGi bundle, is to drag it onto the "Local" repository entry in the "Repositories" view, or to use the "Add files to repository" toolbar icon. Bndtools will analyze the files you try to add and show their metadata if they're indeed valid bundles. @@ -241,10 +269,11 @@ within Apache ACE. If your library does "...add an OSGi bundle" instructions above. 1. Copy the library to the right location. The jar file for the library should be copied -to the following location: cnf/lib/foo/foo-1.0.0.jar. Note that the directory -name should be equal to the basename of the added JAR file, that is, everything *before* -the version-string of the JAR; + to the following location: cnf/lib/foo/foo-1.0.0.jar. Note that the directory + name should be equal to the basename of the added JAR file, that is, everything + *before* the version-string of the JAR; 2. Refresh the repositories in Bnd by invoking "Bndtools -> Refresh Repositories". -Your library should be now available "Repositories" view and can be used normally in -any OSGi project. +Your library should be now available "Repositories" view and can be used normally in any +OSGi project. +