Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this is me trying to follow your example @fbmnds #124

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ suave.sln.DotSettings.user
gh-pages/
AssemblyVersionInfo.fs
miTLS/
buildsupport/FSharp.Formatting.CommandTool/
53 changes: 44 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,18 @@ task :create_nuget_quick => ['build/pkg', :versioning] do
m.language = 'en-GB'
m.copyright = 'Ademar Gonzalez'
m.release_notes = "Full version: #{ENV['BUILD_VERSION']}."
m.license_url = "https://github.com/ademar/suave/blob/master/COPYING"
m.project_url = "http://suave.io"
m.license_url = "https://github.com/ademar/suave/blob/master/COPYING"
m.project_url = "http://suave.io"
end
p.add_file "Suave/bin/Release/suave.dll", "lib"
p.add_file "Suave/bin/Release/suave.xml", "lib"
nuspec_path = 'suave.nuspec'
File.write(nuspec_path,p.to_xml)
cmd = Albacore::NugetsPack::Cmd.new "buildsupport/NuGet.exe", out: "build/pkg"
pkg, spkg = cmd.execute nuspec_path

File.write('suave.nuspec', p.to_xml)
cmd = Albacore::NugetsPack::Cmd.new 'buildsupport/NuGet.exe', out: 'build/pkg'
pkg, _ = cmd.execute 'suave.nuspec'

Albacore.publish :artifact, OpenStruct.new(
:nuspec => nuspec_path,
:nuspec => 'suave.nuspec',
:nupkg => pkg,
:location => pkg
)
Expand Down Expand Up @@ -118,7 +119,7 @@ namespace :docs do
end

desc 'build documentation'
task :build => :clean do
task :text => :clean do
system 'git clone https://github.com/SuaveIO/suave.git -b gh-pages gh-pages' unless Dir.exists? 'gh-pages'
Dir.chdir 'gh-pages' do
Bundler.with_clean_env do
Expand All @@ -128,8 +129,42 @@ namespace :docs do
end
end

task :fsformatting do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you clean this directory or is it overwritten?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NuGet packages are 'immutable' not overwritten at all, just not re-downloaded after nuget verifies they are there.

cp_r overwrites files, yes, every time.

system 'buildsupport/NuGet.exe',
%w|install FSharp.Formatting.CommandTool
-OutputDirectory buildsupport/
-ExcludeVersion|, clr_command: true
end

task :api_quick do
# use templates e.g of Fake project at 'https://github.com/fsharp/FAKE/tree/master/help/templates'
md = %w|page-description F#\ Suave
page-author Ademar\ Gonzalez,\ Henrik\ Feldt
project-author Ademar\ Gonzalez,\ Henrik\ Feldt
github-link https://github.com/SuaveIO/suave
project-github https://github.com/SuaveIO/suave
project-nuget https://www.nuget.org/packages/Suave
root http://suave.io
project-name Suave|

# transform parameter into one string, separated by blanks, embedded into double quotes
# transform cmd into one string, separated by blanks
system 'buildsupport/FSharp.Formatting.CommandTool/tools/fsformatting.exe',
%w|metadataFormat
--generate
--dllFiles Suave/bin/Release
--outDir gh-pages/api
--layoutRoots gh-pages/_fs_formatting
--sourceRepo https://github.com/SuaveIO/suave/tree/master/Suave
--sourceFolder Suave
--parameter|.concat(md).flatten, clr_command: true
end

desc 'build API docs'
task :api => [:build, :fsformatting, :api_quick]

desc 'build and push docs'
task :push => :'docs:build' do
task :push => :'docs:text' do
system "sshpass -p #{ENV['SUAVE_SERVER_PASS']} scp -P #{ENV['SUAVE_SERVER_PORT']} -r _site/* [email protected]:/home/suave/site",
work_dir: 'gh-pages'
end
Expand Down