Skip to content

Update fsharp/tutorials/getting-started-command-line - #1521

Merged
spboyer merged 15 commits into
csprojfrom
issue-1514
Feb 17, 2017
Merged

spboyer merged 15 commits into
csprojfrom
issue-1514

Conversation

@spboyer

@spboyer spboyer commented Feb 6, 2017

Copy link
Copy Markdown
Contributor

Update fsharp tutorial for RC4-004769

Summary

  • tutorial update. remove project.json
  • dotnet new updates
  • added dotnet add reference
  • added dotnet add package

Fixes #1514

Suggested Reviewers

@cartermp @BlackDwarf

@cartermp cartermp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM module tiny comments.

Use the `dotnet new` command, create a Class Library project in the **src** folder named Library.

```bash
dotnet new classlib -lang F# -o src/Library

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be --lang?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes. this is why -- stink!

Use the `dotnet new` command, create a Console app in the **src** folder named App.

```bash
dotnet new console -lang F# -o src/App

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ditto regarding --lang

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ditto ^^

@spboyer

spboyer commented Feb 6, 2017

Copy link
Copy Markdown
Contributor Author

@cartermp -lang is the shorthand, --language longhand

@cartermp

cartermp commented Feb 6, 2017

Copy link
Copy Markdown
Contributor

Ah I see. LGTM!

@mairaw mairaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

left a few comments

dotnet build
```

>[!NOTE] `restore` and `build` assumes the current directory contains the project file, otherwise pass in the location. For example, `dotnet restore src/Library/Library.fsproj`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you're getting a build warning because the note content needs to be in a new line
also, it would probably be better to say dotnet restore and dotnet build.
Missing punctuation too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

## Prerequisites

To begin, you must install the [.NET Core SDK 1.0.0 - Preview 2 (build 003131)](https://dot.net/core). There is no need to uninstall a previous version of the .NET Core SDK, as it supports side-by-side installations.
To begin, you must install the [.NET Core SDK 1.0.3 - (build 004769)](https://dot.net/core). There is no need to uninstall a previous version of the .NET Core SDK, as it supports side-by-side installations.

@mairaw mairaw Feb 6, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe say build 004769 or later since by RTM the build number will be much higher.

2. Create a new directory named `FSNetCore`. Open Visual Studio code or your preferred editor inside this directory.
3. Under `FSNetCore`, create `src` and `test` directories.
4. Under `FSNetCore`, create a new file called `global.json`. It should have this as its contents:
4. Under `FSNetCore`, create a new file called `global.json`. It should have the following contents:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this seems wrong now. global.json now only supports specifying the sdk version. you should probably replace these steps with dotnet new sln and dotnet sln add

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't like this step either, will make the change to sln

sprintf "I used to be %s but now I'm %s thanks to JSON.NET!" value (JsonConvert.SerializeObject(value))
```

Add the Newtonsoft.Json nuget package to the Library project.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nuget -> NuGet, also probably be consistent with punctuation here and other sentences. probably end in colon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed.

dotnet add package Newtonsoft.Json
```

Restore the nuget dependencies

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ditto ^

@@ -27,7 +27,7 @@ This article assumes that you know how to use a command line and have a preferre
1. Open a Command Line/Terminal.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you didn't change this but style guide says that "Describe entering commands at a command prompt, not on a command line.", so probably this should be changed to Open a command prompt/terminal.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made the change for this one instance. The title is "Getting started with Command Line.." should we consider changing all instances of "command line" to "command prompt"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@spboyer it's ok to use when talking in the context of the tooling. I thought just that step could be wrong. You can go to http://style to see more info on that.

dotnet restore
```

and build the project

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and build -> Build

6. Run `dotnet restore` and `dotnet build`. These should succeed.
Use the `dotnet new` command, create a Class Library project in the **src** folder named Library.

```bash

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wondering if inline code would look better for these commands. it looks kind of noisy with the language identifiers:
image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agreed, made the change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

bash is not a supported language identifier for docs so the colorization is funky on this command.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This needs to be fixed as a supported lang identifier - @dend
What do we use instead? powershell ? Using nothing gives a MD lint warning.

@spboyer

spboyer commented Feb 7, 2017

Copy link
Copy Markdown
Contributor Author

removed the global.json and added dotnet sln commands. Much cleaner.

@mairaw mairaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! I have some suggestions because if we cut too much, customers can lose context. See what you think.

"projects":[ "src", "test" ]
}
```bash
dotnet new sln -o FSNetCore`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this has a stray backtick in the end

```

Your solutions structure should now look like this:
Change directories to `FSNetCore` and start adding projects to the solution folder.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

removing the first steps make me lost on where the directories are now and what exactly I need to do. I think it should look similar to this:

1. Open a command prompt/terminal.
2. Create a new directory named *FSNetCore*.
3. In the *FSNetCore* folder, use the `dotnet new` command to create new solution file:
`dotnet new sln`
4. Under *FSNetCore*, create *src* and *test* directories.

Thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The test directory is not needed or used in this walkthrough. The dotnet new console -lang F# -o src/Library creates the src directory. I will add "Here is what the directory structure looks like after running the command" to help illustrate.


[<EntryPoint>]
let main argv =
printfn "Nice command line arguments! Here's what JSON.NET has to say about them:"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

command line -> command-line (hyphened when used as an adjective)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is the output of the program.

@spboyer

spboyer commented Feb 9, 2017

Copy link
Copy Markdown
Contributor Author

@mairaw added the directory output and addressed the edits. I like the flow here. Thoughts?

@mairaw mairaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the article and the flow, please don't get me wrong. But I still feel the first step should be to create the directory used in the sample FSNetCore. Found a few more things to be fixed.

6. Run `dotnet restore` and `dotnet build`. These should succeed.
Use the `dotnet new` command, create a Class Library project in the **src** folder named Library.

```bash

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

bash is not a supported language identifier for docs so the colorization is funky on this command.

|---src/
|---test/
|---global.json
FSNEtCore

@mairaw mairaw Feb 13, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FSNEtCore -> FSNetCore in all instances where this occurs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed.

├── FSNEtCore.sln
```

Change directories to `FSNetCore` and start adding projects to the solution folder.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: our style guide says to style file names and paths as italic. This topic is inconsistent on that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -18,139 +18,133 @@ This article covers how you can get started with using F# on .NET Core 1.0 with

@mairaw mairaw Feb 13, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The line above talks about Preview 2. The version should be removed from the introduction and just be called out in the Prerequisites.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed the version.

dotnet sln add src/Library/Library.fsproj
```

Restore the NuGet dependencies, `dotnet restore` and run `dotnet build` to Build the project.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lowercase build

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

last feedback you stated "B"uild? - undone.

```
Nice command-line arguments! Here's what JSON.NET has to say about them:

I used to be Hello but now I'm ""Hello""!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this the right output? the function above seems to have something like "thanks to JSON.NET" in the end.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, that is correct. apparently the original was never tested. :-)

@mairaw mairaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks @spboyer!

@spboyer
spboyer merged commit 390dd25 into csproj Feb 17, 2017
@mairaw
mairaw deleted the issue-1514 branch February 17, 2017 18:08
BillWagner added a commit that referenced this pull request Mar 7, 2017
* Updated publishing getting started

* Converted project.json to MSBuild

* Updated csproj files to default.

* Revised VSCode topic for MSBuild-based projects

* Tutorials revised for *.csproj projects (#1488)

* Converted some project.json projects

* Replaced csproj project file.

* Updated publishing getting started

* Converted project.json to MSBuild

* Updated csproj files to default.

* Revised VSCode topic for MSBuild-based projects

* Tutorials revised for *.csproj projects (#1488)

* Remove project-json.md (#1520)

* remove doc

* changed to redirect per feedback

* updates, remove from toc

* Updated library examples for csproj.

* Revised xml doc comments topic for csproj

* Addressed comments, fixed some other issues.

* Converted samples to csproj.

* Modified build-related information.

* Addressed comments

* Changed relative URLs to absolute

* Changed links from github to docs

* Update fsharp/tutorials/getting-started-command-line (#1521)

* Updated publishing getting started

* Converted project.json to MSBuild

* Updated csproj files to default.

* Revised VSCode topic for MSBuild-based projects

* Tutorials revised for *.csproj projects (#1488)

* fsharp update to 004769

* fixing --

* undoing --

* address feedback

* addressed nits

* remove global.json add dotnet sln

* add directory output

* add dash to command line in code.

* fixing feedback

* change ms.date

* Update mstest tutorial for csproj (#1531)

* Remove project-json.md (#1520)

* remove doc

* changed to redirect per feedback

* updates, remove from toc

* Update testingng with MSTest for csproj

This topic now mirrors the unit testing with dotnet test and xunit.

* update topic for multiple platforms

This meant updating the index file, the TOC, and adding redirection due
to the file name change.

* Add the meta tag to redirect LiveFyre comments.

* Update per feedback

* Final review and proofread

* Update per feedback on PR #1538

* respond to feedback.

* fixed product name

* Revised out parameter modifier for C# 7

* Corrected bad code example links.

* Fixed one more broken link.

* Fixed alert.

* C# 7 revision of throw

* Corrected code dropout in Lambda Expressions topic.

* Fixed bad code snippet end tag

* project migration from project.json to csproj

* Revised for csproj migration

* Replaced incorrect version of csproj file

* Additional topic added

* Samples ported to MSBuild

* Fix typo

* bringing changes back

* Update pattern matching to fix a couple small issues (#1612)

* Update pattern matching to fix a couple small issues

1. Update feature name for pattern matching (issue #1479)
2. Update description of match expressions to explain that match
expressions in the wrong order generate a compiler error (Issue #1585)

* fix build issues.

Directory move because the solution directory isn’t needed.

* missed one set of build errors.

* update to the 1.1 meta package.

* temporarily disable enable_incremental_build (#1643)

* Addressed review comments

* Incorporated review comments

* removing test protocol doc (#1615)

* uses raw version of sampleQuotes.txt in link (#1652)

This makes it easier to `wget` the file.

* dotnet new updates for MSBuild/csproj (#1649)

* Update index.md

* Update index.md

* Update dependencies.md

* Update index.md

* Update dependencies.md

* Update dotnet.md

* Update index.md

* Update dependencies.md

* Update using-with-xplat-cli-msbuild-folders.md

* Update getting-started-command-line.md

* Update with-visual-studio-code.md

* Update attributes.md

* Update console-teleprompter.md

* Update console-webapiclient.md

* Update attributes.md

* Update inheritance.md

* Update string-interpolation.md

* Update working-with-linq.md

* Update working-with-linq.md

* Update dotnet-migrate.md

* Update using-with-xplat-cli-msbuild-folders.md

* Update using-with-xplat-cli-msbuild-folders.md

* Update dotnet-new.md

* Update dotnet-add-package.md

* Update dotnet-add-reference.md

* Update dotnet-build.md

* Update dotnet-add-reference.md

* Update dotnet-add-package.md

* Update dotnet-clean.md

* Update dotnet-build.md

* Update dotnet-clean.md

* Update dotnet-install-script.md

* Update dotnet-build.md

* Update dotnet-build.md

* Update dotnet-install-script.md

* Update dotnet-list-reference.md

* Update dotnet-msbuild.md

* Update dotnet-new.md

* Update dotnet-nuget-delete.md

* Update dotnet-nuget-locals.md

* Update dotnet-msbuild.md

* dotnet command updates

* Update broken xref

* Update dotnet-pack.md

* Update dotnet-publish.md

* Update using-with-xplat-cli-msbuild-folders.md

* Update with-visual-studio-code.md

* 💥 removing preview3 folder (#1650)

* test redirection with document id

removing dotnet-new from preview3

* 💥 removing preview3 folder

* removed warnings and RC4 mentions

fixing build issues

fixing more build issues

* addressed feedback

more fixes

* rebase and fixes

* fixes

* cleanup

* fix broken link

* Migration and build, publish & run fixes (#1592)

* Migration and build, publish & run fixes

This adds the migraiton document into a migration folder under the
Preview 3 folder. The migration document covers the migration from
project.json to csproj using the automated tools, points to the old DNX
migration for those people that still use that and offers some advice on
getting from pre-RC4 csproj to RC4 (and thus RTW) csproj formats.

The change also adds some content to the dotnet build, dotnet run and
dotnet publish documents to make sure that their differences are clearly
outlined.

Fixes #1512, #1509, #1515

* Fixing broken links

* Responding to PR feedback

* Responding to PR feedback.

* Resolving build breaks

* Fixing build breaks...again.

* some updates

* fixed toc entry

* addressed feedback + fixes

* more fixes

* few more fixes

* removing preview3 links

* Update getting started on macos (#1560)

* update getting started for csproj build system.

Updates all the application code,
the text in the MD file,
and the updated VS Code debugging settings.

* Update for new VS code extension behavior.

* respond to feedback.

* remove version specific notes on the SDK.

* Update the docker getting started topic. (#1503)

* Update the docker getting started topic.

* fix build errors

And update Docker build instructions

* update instructions to use dotnet add package

* Update Unit Testing with XUnit (#1487)

* Remove project-json.md (#1520)

* remove doc

* changed to redirect per feedback

* updates, remove from toc

* run dotnet migrate

* build and run tests

* move projects to the correct updated location

* Update project files and code.

* fix a file name.

* mis-typed the region name.

* proofread and update.

This is ready for review and mergning.

* update instructions to use the new CLI command.

* use updated commands

the older commands still work, but it’s better to standardize on the
new names.

* remove note about .NET Core 1.0

* update for correct xUnit branding.

* small fixes (#1655)

* Documented C# when keyword (#1647)

* documented when keyword

* Incorporated review comments

* Switch statement revised for C# 7 (#1640)

* Switch statement revised for C# 7

* Fixed bad links

* Changed 'switch expression' to 'match expression'

* Addressed review comments.

* Added code snippet tags.

* modified code

* update dotnet-install script topic (#1618)

* update dotnet-install script

* fixed word dropout

* Changes to dotnet new (#1637)

* changes to dotnet new

* removed current dir from the summary

* a few more edits

* fix two broken links. (#1657)

* fix two broken links.

* fix more bad links.

* removing RC4 from the menu

* more fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants