From e6d54b59accc3f95ba6d4f73b1fe2509b11421de Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Mon, 22 Oct 2012 11:14:22 +0200 Subject: [PATCH] #2623 - Adding a @github@ substitution for links to github, as well as adding a pointer as to where to find the example code for the docs. --- akka-docs/rst/cluster/cluster-usage-java.rst | 6 +++--- akka-docs/rst/dev/developer-guidelines.rst | 2 +- akka-docs/rst/intro/what-is-akka.rst | 3 +++ akka-docs/rst/java/camel.rst | 16 ++++++++-------- akka-docs/rst/java/remoting.rst | 2 +- akka-docs/rst/scala/actors.rst | 2 +- akka-docs/rst/scala/camel.rst | 16 ++++++++-------- akka-docs/rst/scala/remoting.rst | 2 +- project/AkkaBuild.scala | 4 +++- project/scripts/release | 6 ------ 10 files changed, 29 insertions(+), 30 deletions(-) diff --git a/akka-docs/rst/cluster/cluster-usage-java.rst b/akka-docs/rst/cluster/cluster-usage-java.rst index 6abe22e700..c674bff3a6 100644 --- a/akka-docs/rst/cluster/cluster-usage-java.rst +++ b/akka-docs/rst/cluster/cluster-usage-java.rst @@ -216,7 +216,7 @@ network failures and JVM crashes, in addition to graceful termination of watched actor. This example is included in ``akka-samples/akka-sample-cluster`` and you can try it by copying the -`source `_ to your +`source <@github@/akka-samples/akka-sample-cluster>`_ to your maven project, defined as in :ref:`cluster_simple_example_java`. Run it by starting nodes in different terminal windows. For example, starting 2 frontend nodes and 3 backend nodes:: @@ -379,7 +379,7 @@ This means that user requests can be sent to ``StatsService`` on any node and it fan out to local children if more parallelism is needed. This example is included in ``akka-samples/akka-sample-cluster`` and you can try it by copying the -`source `_ to your +`source <@github@/akka-samples/akka-sample-cluster>`_ to your maven project, defined as in :ref:`cluster_simple_example_java`. Run it by starting nodes in different terminal windows. For example, starting 3 service nodes and 1 client:: @@ -416,7 +416,7 @@ All nodes start ``StatsFacade`` and the router is now configured like this: .. includecode:: ../../../akka-samples/akka-sample-cluster/src/main/java/sample/cluster/stats/japi/StatsSampleOneMasterMain.java#start-router-deploy This example is included in ``akka-samples/akka-sample-cluster`` and you can try it by copying the -`source `_ to your +`source <@github@/akka-samples/akka-sample-cluster>`_ to your maven project, defined as in :ref:`cluster_simple_example_java`. Run it by starting nodes in different terminal windows. For example, starting 3 service nodes and 1 client:: diff --git a/akka-docs/rst/dev/developer-guidelines.rst b/akka-docs/rst/dev/developer-guidelines.rst index a8971f7fbf..c8acfe33cc 100644 --- a/akka-docs/rst/dev/developer-guidelines.rst +++ b/akka-docs/rst/dev/developer-guidelines.rst @@ -55,7 +55,7 @@ There is a testing standard that should be followed: `Ticket001Spec `_. It enables assertions concerning replies received and their timing, there is more documentation in the :ref:`akka-testkit` module. +There is a useful test kit for testing actors: `akka.util.TestKit <@github@/akka-testkit/src/main/scala/akka/testkit/TestKit.scala>`_. It enables assertions concerning replies received and their timing, there is more documentation in the :ref:`akka-testkit` module. Multi-JVM Testing ^^^^^^^^^^^^^^^^^ diff --git a/akka-docs/rst/intro/what-is-akka.rst b/akka-docs/rst/intro/what-is-akka.rst index dc351b0d22..8ca103351d 100644 --- a/akka-docs/rst/intro/what-is-akka.rst +++ b/akka-docs/rst/intro/what-is-akka.rst @@ -20,6 +20,9 @@ Akka is Open Source and available under the Apache 2 License. Download from http://akka.io/downloads/ +Please note that all code samples compile, so if you want direct access to the sources, have a look +over at the `Akka Docs Project <@github@/akka-docs/rst>`_. + Akka implements a unique hybrid =============================== diff --git a/akka-docs/rst/java/camel.rst b/akka-docs/rst/java/camel.rst index 429454f25d..9eff4ae561 100644 --- a/akka-docs/rst/java/camel.rst +++ b/akka-docs/rst/java/camel.rst @@ -132,7 +132,7 @@ An ``ActivationTimeoutException`` is thrown if the endpoint could not be activat Deactivation of a Consumer or a Producer actor happens when the actor is terminated. For a Consumer, the route to the actor is stopped. For a Producer, the `SendProcessor`_ is stopped. A ``DeActivationTimeoutException`` is thrown if the associated camel objects could not be deactivated within the specified timeout. -.. _Camel: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/Camel.scala +.. _Camel: @github@/akka-camel/src/main/scala/akka/camel/Camel.scala .. _CamelContext: https://svn.apache.org/repos/asf/camel/tags/camel-2.8.0/camel-core/src/main/java/org/apache/camel/CamelContext.java .. _ProducerTemplate: https://svn.apache.org/repos/asf/camel/tags/camel-2.8.0/camel-core/src/main/java/org/apache/camel/ProducerTemplate.java .. _SendProcessor: https://svn.apache.org/repos/asf/camel/tags/camel-2.8.0/camel-core/src/main/java/org/apache/camel/processor/SendProcessor.java @@ -146,7 +146,7 @@ class. For example, the following actor class (Consumer1) implements the `getEndpointUri` method, which is declared in the `UntypedConsumerActor`_ class, in order to receive messages from the ``file:data/input/actor`` Camel endpoint. -.. _UntypedConsumerActor: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/javaapi/UntypedConsumer.scala +.. _UntypedConsumerActor: @github@/akka-camel/src/main/scala/akka/camel/javaapi/UntypedConsumer.scala .. includecode:: code/docs/camel/Consumer1.java#Consumer1 @@ -156,7 +156,7 @@ actor. Messages consumed by actors from Camel endpoints are of type `CamelMessage`_. These are immutable representations of Camel messages. .. _file component: http://camel.apache.org/file2.html -.. _Message: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/CamelMessage.scala +.. _Message: @github@/akka-camel/src/main/scala/akka/camel/CamelMessage.scala Here's another example that sets the endpointUri to @@ -176,7 +176,7 @@ client the response type should be `CamelMessage`_. For any other response type, new CamelMessage object is created by akka-camel with the actor response as message body. -.. _Message: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/CamelMessage.scala +.. _Message: @github@/akka-camel/src/main/scala/akka/camel/CamelMessage.scala .. _camel-acknowledgements-java: @@ -221,7 +221,7 @@ The timeout on the consumer actor can be overridden with the ``replyTimeout``, a .. includecode:: code/docs/camel/Consumer4.java#Consumer4 .. _Exchange: https://svn.apache.org/repos/asf/camel/tags/camel-2.8.0/camel-core/src/main/java/org/apache/camel/Exchange.java -.. _ask: http://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/pattern/Patterns.scala +.. _ask: @github@/akka-actor/src/main/scala/akka/pattern/Patterns.scala Producer Actors =============== @@ -296,7 +296,7 @@ For initiating a a two-way message exchange, one of the .. includecode:: code/docs/camel/RequestBodyActor.java#RequestProducerTemplate -.. _UntypedProducerActor: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/javaapi/UntypedProducerActor.scala +.. _UntypedProducerActor: @github@/akka-camel/src/main/scala/akka/camel/javaapi/UntypedProducerActor.scala .. _ProducerTemplate: https://svn.apache.org/repos/asf/camel/tags/camel-2.8.0/camel-core/src/main/java/org/apache/camel/ProducerTemplate.java .. _camel-asynchronous-routing-java: @@ -361,7 +361,7 @@ Akka Camel components Akka actors can be accessed from Camel routes using the `actor`_ Camel component. This component can be used to access any Akka actor (not only consumer actors) from Camel routes, as described in the following sections. -.. _actor: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala +.. _actor: @github@/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala .. _access-to-actors-java: @@ -372,7 +372,7 @@ To access actors from custom Camel routes, the `actor`_ Camel component should be used. It fully supports Camel's `asynchronous routing engine`_. -.. _actor: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala +.. _actor: @github@/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala .. _asynchronous routing engine: http://camel.apache.org/asynchronous-routing-engine.html This component accepts the following endpoint URI format: diff --git a/akka-docs/rst/java/remoting.rst b/akka-docs/rst/java/remoting.rst index efd4b0e43f..aab5a1b013 100644 --- a/akka-docs/rst/java/remoting.rst +++ b/akka-docs/rst/java/remoting.rst @@ -193,7 +193,7 @@ Description of the Remoting Sample There is a more extensive remote example that comes with the Akka distribution. Please have a look here for more information: `Remote Sample -`_ +<@github@/akka-samples/akka-sample-remote>`_ This sample demonstrates both, remote deployment and look-up of remote actors. First, let us have a look at the common setup for both scenarios (this is ``common.conf``): diff --git a/akka-docs/rst/scala/actors.rst b/akka-docs/rst/scala/actors.rst index 3000a2e55a..e81f744952 100644 --- a/akka-docs/rst/scala/actors.rst +++ b/akka-docs/rst/scala/actors.rst @@ -671,7 +671,7 @@ The ``become`` method is useful for many different things, but a particular nice example of it is in example where it is used to implement a Finite State Machine (FSM): `Dining Hakkers`_. -.. _Dining Hakkers: http://github.com/akka/akka/blob/master/akka-samples/akka-sample-fsm/src/main/scala/DiningHakkersOnBecome.scala +.. _Dining Hakkers: @github@/akka-samples/akka-sample-fsm/src/main/scala/DiningHakkersOnBecome.scala Here is another little cute example of ``become`` and ``unbecome`` in action: diff --git a/akka-docs/rst/scala/camel.rst b/akka-docs/rst/scala/camel.rst index 292324e26d..c1a0e35789 100644 --- a/akka-docs/rst/scala/camel.rst +++ b/akka-docs/rst/scala/camel.rst @@ -129,7 +129,7 @@ An ``ActivationTimeoutException`` is thrown if the endpoint could not be activat Deactivation of a Consumer or a Producer actor happens when the actor is terminated. For a Consumer, the route to the actor is stopped. For a Producer, the `SendProcessor`_ is stopped. A ``DeActivationTimeoutException`` is thrown if the associated camel objects could not be deactivated within the specified timeout. -.. _Camel: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/Camel.scala +.. _Camel: @github@/akka-camel/src/main/scala/akka/camel/Camel.scala .. _CamelContext: https://svn.apache.org/repos/asf/camel/tags/camel-2.8.0/camel-core/src/main/java/org/apache/camel/CamelContext.java .. _ProducerTemplate: https://svn.apache.org/repos/asf/camel/tags/camel-2.8.0/camel-core/src/main/java/org/apache/camel/ProducerTemplate.java .. _SendProcessor: https://svn.apache.org/repos/asf/camel/tags/camel-2.8.0/camel-core/src/main/java/org/apache/camel/processor/SendProcessor.java @@ -143,7 +143,7 @@ trait. For example, the following actor class (Consumer1) implements the endpointUri method, which is declared in the Consumer trait, in order to receive messages from the ``file:data/input/actor`` Camel endpoint. -.. _Consumer: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/Consumer.scala +.. _Consumer: @github@/akka-camel/src/main/scala/akka/camel/Consumer.scala .. includecode:: code/docs/camel/Consumers.scala#Consumer1 @@ -153,7 +153,7 @@ actor. Messages consumed by actors from Camel endpoints are of type `CamelMessage`_. These are immutable representations of Camel messages. .. _file component: http://camel.apache.org/file2.html -.. _Message: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/CamelMessage.scala +.. _Message: @github@/akka-camel/src/main/scala/akka/camel/CamelMessage.scala Here's another example that sets the endpointUri to @@ -173,7 +173,7 @@ client the response type should be `CamelMessage`_. For any other response type, new CamelMessage object is created by akka-camel with the actor response as message body. -.. _CamelMessage: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/CamelMessage.scala +.. _CamelMessage: @github@/akka-camel/src/main/scala/akka/camel/CamelMessage.scala .. _camel-acknowledgements: @@ -218,7 +218,7 @@ The timeout on the consumer actor can be overridden with the ``replyTimeout``, a .. includecode:: code/docs/camel/Consumers.scala#Consumer4 .. _Exchange: https://svn.apache.org/repos/asf/camel/tags/camel-2.8.0/camel-core/src/main/java/org/apache/camel/Exchange.java -.. _ask: http://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/pattern/AskSupport.scala +.. _ask: @github@/akka-actor/src/main/scala/akka/pattern/AskSupport.scala Producer Actors =============== @@ -292,7 +292,7 @@ For initiating a a two-way message exchange, one of the .. includecode:: code/docs/camel/Producers.scala#RequestProducerTemplate -.. _Producer: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/Producer.scala +.. _Producer: @github@/akka-camel/src/main/scala/akka/camel/Producer.scala .. _ProducerTemplate: https://svn.apache.org/repos/asf/camel/tags/camel-2.8.0/camel-core/src/main/java/org/apache/camel/ProducerTemplate.java .. _camel-asynchronous-routing: @@ -357,7 +357,7 @@ Akka Camel components Akka actors can be accessed from Camel routes using the `actor`_ Camel component. This component can be used to access any Akka actor (not only consumer actors) from Camel routes, as described in the following sections. -.. _actor: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala +.. _actor: @github@/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala .. _access-to-actors: @@ -368,7 +368,7 @@ To access actors from custom Camel routes, the `actor`_ Camel component should be used. It fully supports Camel's `asynchronous routing engine`_. -.. _actor: http://github.com/akka/akka/blob/master/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala +.. _actor: @github@/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala .. _asynchronous routing engine: http://camel.apache.org/asynchronous-routing-engine.html This component accepts the following endpoint URI format: diff --git a/akka-docs/rst/scala/remoting.rst b/akka-docs/rst/scala/remoting.rst index c866e9c1e6..db5ddbf170 100644 --- a/akka-docs/rst/scala/remoting.rst +++ b/akka-docs/rst/scala/remoting.rst @@ -200,7 +200,7 @@ Description of the Remoting Sample There is a more extensive remote example that comes with the Akka distribution. Please have a look here for more information: `Remote Sample -`_ +<@github@/akka-samples/akka-sample-remote>`_ This sample demonstrates both, remote deployment and look-up of remote actors. First, let us have a look at the common setup for both scenarios (this is ``common.conf``): diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index a54aea55a5..35a28de088 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -533,6 +533,7 @@ object AkkaBuild extends Build { // customization of sphinx @@ replacements, add to all sphinx-using projects // add additional replacements here preprocessVars <<= (scalaVersion, version) { (s, v) => + val isSnapshot = v.endsWith("SNAPSHOT") val BinVer = """(\d+\.\d+)\.\d+""".r Map( "version" -> v, @@ -548,7 +549,8 @@ object AkkaBuild extends Build { "binVersion" -> (s match { case BinVer(bv) => bv case _ => s - }) + }), + "github" -> "http://github.com/akka/akka/tree/%s".format((if (isSnapshot) "master" else "v" + v)) ) }, preprocess <<= (sourceDirectory, target in preprocess, cacheDirectory, preprocessExts, preprocessVars, streams) map { diff --git a/project/scripts/release b/project/scripts/release index 1dd5d9d3ae..50244cc0ca 100755 --- a/project/scripts/release +++ b/project/scripts/release @@ -203,12 +203,6 @@ try git checkout -b ${release_branch} # find and replace the version try ${script_dir}/find-replace ${current_version} ${version} -#find and replace github links -try ${script_dir}/find-replace http://github.com/akka/akka/tree/master http://github.com/akka/akka/tree/v${version} -try ${script_dir}/find-replace https://github.com/akka/akka/tree/master http://github.com/akka/akka/tree/v${version} -try ${script_dir}/find-replace http://github.com/akka/akka/blob/master http://github.com/akka/akka/tree/v${version} -try ${script_dir}/find-replace https://github.com/akka/akka/blob/master http://github.com/akka/akka/tree/v${version} - # start clean try sbt clean