diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0b8a6a3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: java +before_install: git config user.name "$GIT_NAME" && git config user.email "$GIT_EMAIL" + && git config credential.helper "store --file=.git/credentials" && echo "https://$GH_TOKEN:@github.com" + > .git/credentials +install: +- mvn install -P docs -q -U -DskipTests=true -Dmaven.test.redirectTestOutputToFile=true +- ./src/main/asciidoc/ghpages.sh +script: mvn --settings .settings.xml deploy -nsu -Dmaven.test.redirectTestOutputToFile=true +env: + global: + - GIT_NAME="Dave Syer" + - GIT_EMAIL=dsyer@pivotal.io + - secure: KKxSrW1qR2iFanuCb7QLaeMqEkb3+7hRpVUlGHOvCPTs3IShNKkYx8aHudiORqMxB+v7qtxxP/ca65hBlCK3fIilg7LholaDnGcTeQm0bhODP67mQ3Pby3XDQzKCwUdAn9U9OPK2Nw9xFVUMisLBAr3riegcN2w+FmkylW8+ffY= diff --git a/README.adoc b/README.adoc new file mode 100644 index 0000000..7ff015d --- /dev/null +++ b/README.adoc @@ -0,0 +1,15 @@ +// Do not edit this file (e.g. go instead to src/main/asciidoc) + +Spring Cloud Starters are curated sets of dependencies focused on a particular type of workload. Including a starter on your classpath is really just a shorthand for including its dependencies, but it makes it easier to organize your code and easier to remember what the depdnencies are for. (See also http://github.com/spring-projects/spring-boot/tree/master/spring-boot-starters[Spring Boot starter projects].) Starters provided include: + +* spring-cloud-starter +* spring-cloud-starter-bus-amqp +* spring-cloud-starter-cloudfoundry +* spring-cloud-starter-eureka +* spring-cloud-starter-eureka-server +* spring-cloud-starter-hystrix +* spring-cloud-starter-hystrix-dashboard +* spring-cloud-starter-turbine +* spring-cloud-starter-zuul + + diff --git a/pom.xml b/pom.xml index d521272..f1f5b97 100644 --- a/pom.xml +++ b/pom.xml @@ -1,26 +1,19 @@ 4.0.0 - - org.springframework.boot - spring-boot-parent - 1.1.5.RELEASE - - org.springframework.cloud spring-cloud-starters 1.0.0.BUILD-SNAPSHOT pom Spring Cloud Starters Spring Cloud Starters - http://projects.spring.io/spring-boot/ - - Pivotal Software, Inc. - http://www.spring.io - - - ${basedir}/.. - + + org.springframework.cloud + spring-cloud-build + 1.0.0.BUILD-SNAPSHOT + + + spring-cloud-starter spring-cloud-starter-bus-amqp @@ -29,10 +22,11 @@ spring-cloud-starter-eureka-server spring-cloud-starter-hystrix spring-cloud-starter-hystrix-dashboard - spring-cloud-starter-security - spring-cloud-starter-turbine - spring-cloud-starter-zuul + spring-cloud-starter-security + spring-cloud-starter-turbine + spring-cloud-starter-zuul + @@ -121,6 +115,7 @@ + @@ -142,6 +137,7 @@ + org.apache.maven.plugins @@ -169,4 +165,30 @@ + + + + docs + + + + org.asciidoctor + asciidoctor-maven-plugin + false + + + org.apache.maven.plugins + maven-antrun-plugin + false + + + org.codehaus.mojo + build-helper-maven-plugin + false + + + + + + diff --git a/src/main/asciidoc/README.adoc b/src/main/asciidoc/README.adoc new file mode 100644 index 0000000..88903ec --- /dev/null +++ b/src/main/asciidoc/README.adoc @@ -0,0 +1,3 @@ +include::intro.adoc[] + + diff --git a/src/main/asciidoc/intro.adoc b/src/main/asciidoc/intro.adoc new file mode 100644 index 0000000..56cd7c7 --- /dev/null +++ b/src/main/asciidoc/intro.adoc @@ -0,0 +1,11 @@ +Spring Cloud Starters are curated sets of dependencies focused on a particular type of workload. Including a starter on your classpath is really just a shorthand for including its dependencies, but it makes it easier to organize your code and easier to remember what the depdnencies are for. (See also http://github.com/spring-projects/spring-boot/tree/master/spring-boot-starters[Spring Boot starter projects].) Starters provided include: + +* spring-cloud-starter +* spring-cloud-starter-bus-amqp +* spring-cloud-starter-cloudfoundry +* spring-cloud-starter-eureka +* spring-cloud-starter-eureka-server +* spring-cloud-starter-hystrix +* spring-cloud-starter-hystrix-dashboard +* spring-cloud-starter-turbine +* spring-cloud-starter-zuul diff --git a/src/main/asciidoc/spring-cloud-starters.adoc b/src/main/asciidoc/spring-cloud-starters.adoc new file mode 100644 index 0000000..ab99848 --- /dev/null +++ b/src/main/asciidoc/spring-cloud-starters.adoc @@ -0,0 +1,5 @@ +== Spring Cloud Starters + +include::intro.adoc[] + + diff --git a/src/main/ruby/generate_readme.sh b/src/main/ruby/generate_readme.sh new file mode 100755 index 0000000..b232502 --- /dev/null +++ b/src/main/ruby/generate_readme.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +base_dir = File.join(File.dirname(__FILE__),'../../..') +src_dir = File.join(base_dir, "/src/main/asciidoc") +require File.join(File.dirname(__FILE__), 'readme.rb') +require 'optparse' + +options = {} +input = "#{src_dir}/README.adoc" + +OptionParser.new do |o| + o.on('-o OUTPUT_FILE', 'Output file (default is stdout)') { |file| options[:to_file] = file unless file=='-' } + o.on('-h', '--help') { puts o; exit } + o.parse! +end + +input = ARGV[0] if ARGV.length>0 + +SpringCloud::Build.render_file(input, options) diff --git a/src/main/ruby/readme.rb b/src/main/ruby/readme.rb new file mode 100644 index 0000000..d39e0d5 --- /dev/null +++ b/src/main/ruby/readme.rb @@ -0,0 +1,54 @@ +require 'open-uri' + +module SpringCloud + module Build + + IncludeDirectiveRx = /^\\?include::([^\[]+)\[(.*?)\]$/ + + class << self + + def process_include out, src, target, attrs + unless target.include?(':') || target.start_with?('/') + target = File.join(src, target) + end + open(target) do |file| + file.each do |line| + self.process(out, File.dirname(target), line) + end + end + end + + def process out, src, line + if ((escaped = line.start_with?('\\include::')) || line.start_with?('include::')) && (match = IncludeDirectiveRx.match(line)) + if escaped + out << line[1..-1] + else + self.process_include out, src, match[1], match[2].strip + end + else + out << line + end + end + + def render_file file, options = {} + + srcDir = File.dirname(file) + out = ["// Do not edit this file (e.g. go instead to src/main/asciidoc)\n","\n"] + File.new(file).each do |line| + self.process(out, srcDir, line) + end + + unless options[:to_file] + puts out + else + File.open(options[:to_file],'w+') do |file| + out.each { |line| file.write(line) } + end + end + + end + + end + + end +end