Code Monkey home page Code Monkey logo

projectscaffold's Introduction

Issue Stats Issue Stats

ProjectScaffold

This project can be used to scaffold a prototypical .NET solution including file system layout and tooling. This includes a build process that:

In order to start the scaffolding process run

> build.cmd // on windows    
$ ./build.sh  // on unix

Read the Getting started tutorial to learn more.

Documentation: http://fsprojects.github.io/ProjectScaffold

Tips for migrating existing project to Scaffold format

* clone ProjectScaffold to new folder
* run the initializing build
* delete .git folder
* copy intitialized scaffold files and folders to original project folder
* git add / commit project -m"first pass migrating to scaffold format" (otherwise git may be confused by next mv)
* git mv necessary project file folders into src folder
* git commit, and any following cleanup

Be sure to do only git mv file renames in a single commit. If you try to commit anything else git will treat the renames as file delete / file add and you will loose history on those files.

Requirements

ProjectScaffold requires a local git installation. You can download git from Git Downloads.

Build Status

Mono .NET
Mono CI Build Status .NET Build Status

Maintainer(s)

The default maintainer account for projects under "fsprojects" is @fsprojectsgit - F# Community Project Incubation Space (repo management)

projectscaffold's People

Contributors

agross avatar akoeplinger avatar allykzam avatar bartelink avatar caindy avatar cdrnet avatar cloudroutine avatar dsyme avatar forki avatar fsgit avatar gusty avatar jackfoxy avatar jeremyabbott avatar klettier avatar kurtschelfthout avatar matthiasweiser avatar matthid avatar mexx avatar mjgpy3 avatar nickbabcock avatar pblasucci avatar rmunn avatar rneatherway avatar rstradling avatar sergey-tihon avatar sideeffffect avatar slesa avatar tpetricek avatar twith2sugars avatar yukitos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

projectscaffold's Issues

Try to use !! file pattern

I don't think

{ BaseDirectory = __SOURCE_DIRECTORY__
  Includes = [ solutionFile +       ".sln"
               solutionFile + ".Tests.sln" ]
  Excludes = [] } 

is a good idea.

Cannot generate documents for projects targeting Framework 4.5 and using specific 4.5 features

I'm working on a project that targets .NET framework 4.5 and uses specific 4.5 features/objects, like IReadOnlyDictionary<K,T>.
When I run build.cmd ReleaseDocs on the dll resulting from compilation the generator crashes (stack trace reported below). If I substitute IReadOnlyDictionary with a simple Dictionary and leave 4.5 as target framework, the docs generation run fine, as well as I change the target framework to 4.0.
It is very likely an issue of FSharp.Formatting. I'll try to checkout the latest version and determine if it has been corrected since the release of the version used by ProjectScaffold.

Generating 'index.html'
Generating 'tutorial.html'
Creating C:\Users\gabriele\Desktop\ProjectScaffold\docs\output\reference
[0 sec] Reading assembly: C:\Users\gabriele\Desktop\ProjectScaffold\docs\tools../../bin\FSCL.Compiler.dll
[0 sec] Parsing assembly
Microsoft.FSharp.Compiler.ErrorLogger+ReportedError: Exception of type 'Microsoft.FSharp.Compiler.Tast+InternalUndefined
ItemRef' was thrown.
at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.Error[b](ErrorLogger x, Exception exn) in
C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\ErrorLogger.fs:line 329
at Microsoft.FSharp.Compiler.Tast.EntityRef.get_Deref() in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tast.f
s:line 2549
at Microsoft.FSharp.Compiler.Tastops.stripTyEqnsA(TcGlobals g, Boolean canShortcut, TType ty) in C:\GitHub\fsharp\FSh
arp.Compiler.Service\src\fsharp\tastops.fs:line 627
at Microsoft.FSharp.Compiler.Tastops.stripTyEqnsAndErase(Boolean eraseFuncAndTuple, TcGlobals g, TType ty) in C:\GitH
ub\fsharp\FSharp.Compiler.Service\src\fsharp\tastops.fs:line 645
at Microsoft.FSharp.Compiler.Tastops.stripTyEqnsWrtErasure(Erasure erasureFlag, TcGlobals g, TType ty) in C:\GitHub\f
sharp\FSharp.Compiler.Service\src\fsharp\tastops.fs:line 666
at Microsoft.FSharp.Compiler.Tastops.typeAEquivAux(Erasure erasureFlag, TcGlobals g, TypeEquivEnv aenv, TType ty1, TT
ype ty2) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tastops.fs:line 837
at Microsoft.FSharp.Collections.ListModule.forall2aux[a,b](FSharpFunc3 f, FSharpList1 list1, FSharpList1 list2) at Microsoft.FSharp.Collections.ListModule.ForAll2[T1,T2](FSharpFunc2 predicate, FSharpList1 list1, FSharpList1 li
st2)
at Microsoft.FSharp.Compiler.Tastops.typeAEquivAux(Erasure erasureFlag, TcGlobals g, TypeEquivEnv aenv, TType ty1, TT
ype ty2) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tastops.fs:line 845
at Microsoft.FSharp.Collections.ListModule.forall2aux[a,b](FSharpFunc3 f, FSharpList1 list1, FSharpList1 list2) at Microsoft.FSharp.Collections.ListModule.ForAll2[T1,T2](FSharpFunc2 predicate, FSharpList1 list1, FSharpList1 li
st2)
at Microsoft.FSharp.Compiler.Tastops.typeAEquivAux(Erasure erasureFlag, TcGlobals g, TypeEquivEnv aenv, TType ty1, TT
ype ty2) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tastops.fs:line 845
at Microsoft.FSharp.Collections.ListModule.TryFind[T](FSharpFunc2 predicate, FSharpList1 list)
at Microsoft.FSharp.Compiler.Tast.ValRef.get_Deref() in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tast.fs:l
ine 2791
at Microsoft.FSharp.Compiler.Tast.get_MembersOfFSharpTyconSorted@845.Invoke(ValRef v) in C:\GitHub\fsharp\FSharp.Comp
iler.Service\src\fsharp\tast.fs:line 845
at Microsoft.FSharp.Primitives.Basics.List.filterToFreshConsTail[a](FSharpList1 cons, FSharpFunc2 f, FSharpList1 l) at Microsoft.FSharp.Primitives.Basics.List.filter[T](FSharpFunc2 predicate, FSharpList1 l) at Microsoft.FSharp.Collections.ListModule.Filter[T](FSharpFunc2 predicate, FSharpList1 list) at <StartupCode$FSharp-Compiler-Service>[email protected](Unit unitVar0) in C:\GitHub\ fsharp\FSharp.Compiler.Service\src\fsharp\vs\Typed.fs:line 258 at Microsoft.FSharp.Compiler.SourceCodeServices.Impl.protect[a](FSharpFunc2 f) in C:\GitHub\fsharp\FSharp.Compiler.S
ervice\src\fsharp\vs\Typed.fs:line 35
at Microsoft.FSharp.Compiler.SourceCodeServices.FSharpEntity.get_MembersFunctionsAndValues() in C:\GitHub\fsharp\FSha
rp.Compiler.Service\src\fsharp\vs\Typed.fs:line 257
at [email protected](IEnumerable1& next) in c:\Tomas\Public\FSharp.Formatti ng\src\FSharp.MetadataFormat\Main.fs:line 0 at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.MoveNextImpl()
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.System-Collections-IEnumerator-MoveNext() at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source)
at [email protected](String cat, IDictionary2 cmds, Comment comment) in c:\Tomas\Publ ic\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 619 at FSharp.MetadataFormat.Reader.readCommentsInto[a](ReadingContext ctx, String xmlDoc, FSharpFunc2 f) in c:\Tomas\Pu
blic\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 506
at FSharp.MetadataFormat.Reader.readType(ReadingContext ctx, FSharpEntity typ) in c:\Tomas\Public\FSharp.Formatting\s
rc\FSharp.MetadataFormat\Main.fs:line 604
at [email protected](ReadingContext ctx, FSharpEntity typ) in c:\Tomas\Pu
blic\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 595
at Microsoft.FSharp.Collections.IEnumerator.choose@163.System-Collections-IEnumerator-MoveNext()
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source) at FSharp.MetadataFormat.Reader.readModulesAndTypes(ReadingContext ctx, IEnumerable1 entities) in c:\Tomas\Public\FS
harp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 596
at FSharp.MetadataFormat.Reader.readNamespace(ReadingContext ctx, String ns, IEnumerable1 entities) in c:\Tomas\Publ ic\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 671 at [email protected](Tuple2 tupledArg) in c:\Tomas\Public\FSharp.Formatting\src\FSh
arp.MetadataFormat\Main.fs:line 695
at [email protected](b& )
at Microsoft.FSharp.Collections.IEnumerator.MapEnumerator1.System-Collections-IEnumerator-MoveNext() at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source)
at FSharp.MetadataFormat.Reader.readAssembly(FSharpAssembly assembly, Boolean publicOnly, String xmlFile, FSharpOptio
n1 sourceFolderRepo) in c:\Tomas\Public\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 690 at <StartupCode$FSharp-MetadataFormat>[email protected](IEnumerable1& next) in c:\Tomas\Public\FS
harp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 812
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.MoveNextImpl() at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.System-Collections-IEnumerator-MoveNext()
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source) at FSharp.MetadataFormat.MetadataFormat.Generate(FSharpList1 dllFiles, String outDir, IEnumerable1 layoutRoots, FSh arpOption1 parameters, FSharpOption1 namespaceTemplate, FSharpOption1 moduleTemplate, FSharpOption1 typeTemplate, FS harpOption1 xmlFile, FSharpOption1 sourceRepo, FSharpOption1 sourceFolder, FSharpOption1 publicOnly, FSharpOption1
libDirs, FSharpOption`1 otherFlags) in c:\Tomas\Public\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 800
at <StartupCode$FSI_0002>.$FSI_0002.main@() in C:\Users\gabriele\Desktop\ProjectScaffold\docs\tools\generate.fsx:line
93

build.sh case sensitivity

The scripts tries to access the non-existing .NuGet directory to execute NuGet.exe which is in the .nuget directory. The script should respect case sensitivity of file names.

Template and Rename .nuspec file

As a part of #22 the .nuspec file should have been templated and renamed. This issue captures that work item.

I believe that testing this manually would simply involve running the "NuGet" target and ensuring the package is generated properly.

Sample issue: FS0078: Unable to find the file 'NuGet.Core.dll'

$ rake docs:build
mono buildsupport/NuGet.exe install FAKE -OutputDirectory buildsupport -ExcludeVersion
Package "FAKE" is already installed.
mono buildsupport/NuGet.exe install FSharp.Formatting -OutputDirectory buildsupport -ExcludeVersion
Package "FSharp.Formatting" is already installed.
mono buildsupport/NuGet.exe install Microsoft.AspNet.Razor -OutputDirectory buildsupport -ExcludeVersion
Package "Microsoft.AspNet.Razor" is already installed.
mono buildsupport/NuGet.exe install RazorEngine -OutputDirectory buildsupport -ExcludeVersion
Attempting to resolve dependency 'Microsoft.AspNet.Razor (≥ 3.0.0)'.
Installing 'RazorEngine 3.4.1'.
Successfully installed 'RazorEngine 3.4.1'.
mono buildsupport/NuGet.exe install FSharp.Compiler.Service -OutputDirectory buildsupport -ExcludeVersion
Installing 'FSharp.Compiler.Service 0.0.50'.
Successfully installed 'FSharp.Compiler.Service 0.0.50'.
mono buildsupport/FAKE/tools/Fake.exe buildsupport/docs.fsx
fsharpi buildsupport/docs.fsx


/Users/henfel/dev/logary/buildsupport/docs.fsx(2,1): error FS0078: Unable to find the file 'NuGet.Core.dll' in any of
 /usr/local/Cellar/mono64/3.4.0/lib/mono/4.5
 /Users/henfel/dev/logary/buildsupport/FSharp.Formatting/lib/net40
 /Users/henfel/dev/logary/buildsupport
 /Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.0/
rake aborted!
Albacore::CommandFailedError: Command failed with status (1):
  mono buildsupport/FAKE/tools/Fake.exe buildsupport/docs.fsx
fsharpi buildsupport/docs.fsx
/Users/henfel/dev/logary/Rakefile.rb:68:in `block (2 levels) in <top (required)>'
Tasks: TOP => docs:build
(See full trace by running task with --trace)

Figured I'd do some nice docs. Getting funky error with latest mono release. Code in question:

namespace :docs do
  task :pre_reqs do
    %w|FAKE FSharp.Formatting Microsoft.AspNet.Razor
       RazorEngine FSharp.Compiler.Service|.each do |dep|
      system 'buildsupport/NuGet.exe', %W|
        install #{dep} -OutputDirectory buildsupport -ExcludeVersion
      |, clr_command: true
    end
  end

  task :build => :pre_reqs do
    system 'buildsupport/FAKE/tools/Fake.exe', 'buildsupport/docs.fsx', clr_command: true
  end
end

Source: https://github.com/logary/logary/blob/master/buildsupport/docs.fsx

Add Initialization Script

Per request from Don Syme, it'd be nice to add an initialization script that does the necessary renamings in one go. Specifically, such a script would have to rename the following (based on user-supplied values):

  • Fsharp.ProjectScaffold.sln
  • src/Fsharp.ProjectTemplate
  • src/Fsharp.ProjectTemplate/Fsharp.ProjectTemplate.fsproj
  • tests/Fsharp.ProjectTemplate.Tests
  • tests/Fsharp.ProjectTemplate.Tests/Fsharp.ProjectTemplate.Tests.fsproj

Additionally, the following files would need their content updated (to reflect the changes listed above):

  • Fsharp.ProjectScaffold.sln (reference to Fsharp.ProjectTemplate.fsproj and Fsharp.ProjectTemplate.Tests.fsproj)
  • Fsharp.ProjectTemplate.fsproj (emitted assembly name)
  • Fsharp.ProjectTemplate.Tests.fsproj (emitted assembly name and reference to Fsharp.ProjectTemplate.fsproj)
  • docs/content/Index.fsx (reference to emitted assembly and project name)
  • docs/content/Tutorial.fsx (reference to emitted assembly and project name)
  • docs/tools/Generate.fsx (emitted assembly name, solution name, github repo name)
  • Build.fsx (solution name, project name, test project emitted assembly name, github repo name)

Also, while the script is changing files, it should probably replace README.md (in the root folder) with something simpler. And it might be nice to set the content of RELEASE_NOTES.md to something generic.

Can't generate docs on Linux or OSX

From a clear clone on OSX 10.9.3 + Mono 3.4.0, after having setup the project info through build.sh, I run build.sh ReleaseDoc and I get the following error:

fsharpi --define:RELEASE generate.fsx

/Users/gabriele/Projects/ProjectScaffold/docs/tools/generate.fsx(29,1): error FS0078: Unable to find the file 'NuGet.Core.dll' in any of
/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.5
/Users/gabriele/Projects/ProjectScaffold/docs/tools/../../packages/FSharp.Formatting.2.4.1/lib/net40
/Users/gabriele/Projects/ProjectScaffold/docs/tools/../../packages/RazorEngine.3.3.0/lib/net40
/Users/gabriele/Projects/ProjectScaffold/docs/tools/../../packages/FSharp.Compiler.Service.0.0.36/lib/net40
/Users/gabriele/Projects/ProjectScaffold/docs/tools
/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.0/

Missing method exception in copyFiles

In generate.fsx, copyFiles() throws the following exception in F# interactive:

System.MissingMethodException: Method not found: 'Microsoft.FSharp.Core.FSharpFunc`2<Boolean,Microsoft.FSharp.Collections.FSharpList`1<System.String>> Fake.FileHelper.CopyRecursive(System.String, System.String)'.
   at FSI_0047.copyFiles()
   at <StartupCode$FSI_0048>.$FSI_0048.main@()

It works when it's called from the command line though.
I'm using Visual Studio 2012 (I don't have VS 2013 installed).

Add documentation tests

I did some improvements to the documentation tests in F# Data and added this to Deedle, so I think that is another nice feature that could be included in the project scaffold.

The code looks for all documentation files and makes sure that they can be type-checked and evaluated without causing an error: https://github.com/tpetricek/Deedle/blob/tpetricek.PerfTests/tests/Deedle.Documentation.Tests/DocTests.fs

AFAIK, the only subtle things are that this seems to work better when the test DLL is compiled using .NET 4.0 + FSharp.Core 4.3.0.0 and the evaluation test currently requires the FSharp.Compiler.Interactive.Settings.dll (I added it here: https://github.com/tpetricek/Deedle/tree/tpetricek.PerfTests/lib).

It runs on Mono too!

Locally-generated documentation has incorrect link to local css and js

On the latest version, I took a clean download, ran build.cmd with some project name. It correctly built and generated everything.

However, the paths to both the "style.css" and "tips.js" in the html output files e.g. content.html are incorrect. They point to "/project-name/content/style.css" and "/project-name/content/tips.js" (where project-name = the name of your project) when they should in fact point to simply "content/style.css" and "content/tips.js" i.e. without the /project-name/ prefix.

Does this work for you on mono?

I'm getting errors like:

 The required attribute "Project" in Import is empty

From what I can only assume is this snippet:

  <Choose>
    <When Condition="'$(VisualStudioVersion)' == '11.0'">
      <PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
        <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
      </PropertyGroup>
    </When>
    <Otherwise>
      <PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
        <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
      </PropertyGroup>
    </Otherwise>
  </Choose>
  <Import Project="$(FSharpTargetsPath)" />

Adding <Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" /> instead works, but I'm not sure about that change.

I tried:

 76   <Choose>
 77     <When Condition="'$(VisualStudioVersion)' == '11.0'">
 78       <PropertyGroup Condition="Exists('..\vendor\FSharp\3.0\Microsoft.FSharp.Targets')">
 79         <FSharpTargetsPath>..\vendor\FSharp\3.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
 80       </PropertyGroup>
 81     </When>
 82     <Otherwise>
 83       <Choose>
 84         <When Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
 85           <PropertyGroup>
 86             <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
 87           </PropertyGroup>
 88         </When>
 89         <Otherwise>
 90           <PropertyGroup>
 91             <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
 92           </PropertyGroup>
 93         </Otherwise>
 94       </Choose>
 95     </Otherwise>
 96   </Choose>
 97   <Import Project="$(FSharpTargetsPath)" />

But that didn't work either, same error message.

Create Visual Studio template

It would be great if you'd create a Visual Studio template for this so that I can choose the 'good' F# project file (fsproj) when I create a new F# project instead of having to hack it manually.

Also, I haven't found a blog entry or other documentation describing the changes to the default fsproj nor how they relate to compiling this on mono and windows: do you have any suggestions on where to look?

Create walk-through covering typical use cases

Given all the new features that've been added, there are several requests in the community for a better description of how to use Scaffold. Ideally, this should be done using Scaffold itself (i.e. generated content).However it maybe less confusing (and reach a wider audience) to put it in a blog or wiki somewhere.

Changed links at bottom of index.fsx to point to initialized project

The links in index.fsx are hard coded to fsprojects/FSharp.ProjectScaffold

https://github.com/fsprojects/ProjectScaffold/blob/master/docs/content/index.fsx#L62-L66

[content]: https://github.com/fsprojects/FSharp.ProjectScaffold/tree/master/docs/content
[gh]: https://github.com/fsprojects/FSharp.ProjectScaffold
[issues]: https://github.com/fsprojects/FSharp.ProjectScaffold/issues
[readme]: https://github.com/fsprojects/FSharp.ProjectScaffold/blob/master/README.md
[license]: https://github.com/fsprojects/FSharp.ProjectScaffold/blob/master/LICENSE.txt

Init.fsx should change this file in order to point to the newly initialized project.

CNAME not copied from content folder

I added a CNAME file to the content folder, but that file is not pulled over with the index.html and tutorial.html files. How do I copy the CNAME over, as well?

Confused about recent changes to master

I've just rolled back the last 4 commits (96ea3be, 9d69ea6, 04cc1db, 88ba4f5) to master, as the seem to have come out of nowhere. The changes made in those commits have been captured into a separate branch called packet. Hopefully, @forki will weigh in on this issue to discuss the motivation behind the (unexpected) commits. At that time, the community will decide what additional actions -- if any -- are needed.

[Enhancement] Generate AssemblyInfo.fs / AssemblyInfo.cs for all projects that form part of build

I have added a few utility features to my build script that I find makes it more flexible. A lot of the AssemblyInfo is the same between different assemblies within the project (With only the title actually changing - and for that I use the project name). Does this seem like a valid enhancement?

Snippet of updated build script:

let fsProjs =  !! "src/**/*.fsproj"
let csProjs = !! "src/**/*.csproj"
fsProjs |> Seq.iter genFSAssemblyInfo
csProjs |> Seq.iter genCSAssemblyInfo

Support for Bash on Windows

Currently most projects using FAKE and based on ProjectScaffold provide two build runners:

  • build.cmd: for cmd.exe using .Net
  • build.sh: for sh/bash using Mono

Unfortunately I cannot build any of these projects directly from bash on Windows (e.g. the MSys bash that comes with Git+win) because build.sh assumes Mono. I fix this in my own projects by adding a third runner:

  • buildn.sh: for sh/bash using .Net (n for .Net)

It could look like the following:

#!/bin/bash

.nuget/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion
.nuget/NuGet.exe install SourceLink.Fake -OutputDirectory packages -ExcludeVersion

if [ ! -e build.fsx ]; then
      packages/FAKE/tools/FAKE.exe init.fsx
fi
packages/FAKE/tools/FAKE.exe build.fsx $@

What are your thoughts on this?
Would you mind if I add such a runner to ProjectScaffold and some of the projects already based on it? Maybe with a better name?

Reconsider Naming Discrepancies

There is a bit a of a disconnect between the names used in this project. Specifically, the GitHub repository name, the VS solution name(s), and the FS project name(s) are all markedly different. Though a low priority, it may be beneficial to normalize all of these at some point.

Consider dropping the tests folder

I think it's better to have the test project together with the main project in the src folder, and include both on a single .sln. This unfortunately is not possible for type providers, but for all other cases I think it's better to have everything loaded at once, it's easier to work that way.
Which brings the question if we shouldn't have two different templates, one for "normal" projects, and other for type provider projects (which have specific requirements)

Build process can't access nuspec file

Invoking the "NuGet" target (either directly or indirectly) fails. Error is as follows:

Running build failed.
Error:
System.Exception: The process cannot access the file './NuGet\FSharp.ProjectTemplate.nuspec' because it is being used by another process.
   at Fake.NuGetHelper.NuGet(FSharpFunc`2 setParams, String nuspecFile)
   at [email protected](Unit _arg8) in D:\Working\FSharp.ProjectScaffold\build.fsx:line 131
   at Fake.TargetHelper.runTarget@284(String targetName)

At this time, unable to determine which process is locking the file. Need to test whether or not this occurs on other machines.

gh-pages are broken

The gh-pages which were uploaded for the scaffold have botched paths (for referencing the supporting FSharp.Formatting resources).

Errors generating documentation

For reasons unknown, the documentation generation task doesn't detect when there are newly placed DLLs in the root bin. Note, this is only an issue if the root been was empty prior to FAKE invocation. Current work-around is to call build once after call 'build clean'. This shouldn't be necessary, as build Release implies build.

Handling parameters inferred to be of any type

The API docs generated from the sample file Library.fs report:

hello num
Signature: num:'?14729 -> int
Type parameters: '?14729

It's probably related to the fact the parameter of the function hello is inferred to be of an arbitrary type 'a.
Not a big issue in itself, but a different syntax (it may be just " 'a ") should be produced.

build.sh issues in linux

There are two more issues with build.sh in a linux (ubuntu 13.10, mono 3.2.8 and fsharp 3.1 under /usr/local/).

i). Another minor issue with case sensitivity
The test:

[ ! -f packages/FAKE/tools/Fake.exe ]

will always succeed because the correct case for the fake executable is: packages/FAKE/tools/FAKE.exe
Thus, even if fake has been previously installed by a previous invocation, the script will try to install it again, causing nuget to uninstall and then install fake on every invocation.

ii). Running the script produces the following output:

~/tmp/FSharp.ProjectScaffold $ sh build.sh
Uninstalling 'FAKE 2.10.9.0'.
Successfully uninstalled 'FAKE 2.10.9.0'.
Installing 'FAKE 2.10.9.0'.
Successfully installed 'FAKE 2.10.9.0'.
fsharpi build.fsx


/home/anirothan/tmp/FSharp.ProjectScaffold/build.fsx(5,1): error FS0078: Unable to find the file 'NuGet.Core.dll' in any of
 /usr/local/lib/mono/4.5
 /home/anirothan/tmp/FSharp.ProjectScaffold
 /usr/local/lib/mono/4.0/

The problem seems to be that dependency assemblies are not searched in the directory containing FAKE.exe, but in the directory that contains build.fsx. Changing the working dirs of build.sh/build.fsx scripts did not seem to work.

I managed to come up with a workaround by temporarily "hijacking" the fsharpi script that is invoked by fake and force a --lib:/packages/FAKE/tools/ argument to the real fsharpi. This is done with the following modified build.sh:

#!/bin/bash
if [ ! -f packages/FAKE/tools/FAKE.exe ]; then
  mono .nuget/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion
fi
export FSHARPI=`which fsharpi`
cat - > fsharpi <<"EOF"
#!/bin/bash
libdir=$PWD/packages/FAKE/tools/
$FSHARPI --lib:$libdir $@
EOF
chmod +x fsharpi
mono packages/FAKE/tools/FAKE.exe build.fsx $@
rm fsharpi

Note: have not tried this in OS X.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.