Merge pull request #107 from aspnet/ReadmeUpdates

Readme updates and deleted build.cmd, lkg.json, kvm.cmd
This commit is contained in:
kirthik 2014-05-12 16:32:10 -07:00
commit ce13e28405
6 changed files with 18 additions and 296 deletions

View File

@ -4,14 +4,18 @@
The first thing we need to do is setup the tools required to build and run an application.
* Clone the repository
* On the command line execute ```kvm setup```
* If you already have ```kvm``` installed on the machine ignore the steps below.
* Clone [Home] (https://github.com/aspnet/Home) repository
* On the command line, cd to Home repository and execute ```kvm setup```
* This command will download the latest version of the SDK and put it on your path so that you can run the rest of the commands in the readme. If you want to know more about what this is doing then you can read the [KVM page](https://github.com/aspnet/Home/wiki/version-manager) of the wiki.
* If you already have ```kvm``` installed on the machine ignore above steps.
* On the command line execute ```kvm install 0.1-alpha-build-0421```
* This command will install Desktop flavor(x86) of KRE build 0421 in your user profile
* Clone MusicStore repository, if you have not already
### Run the application:
1. Run ```build.cmd``` to restore all the necessary packages and generate project files
2. Open a command prompt and cd ```\src\<AppFolder>\```
1. Open a command prompt and cd ```\src\<AppFolder>\```
2. Run ```kpm restore``` to restore all the necessary packages and generate project files
Note: ```kpm restore``` currently works only on Desktop flavor. If you intend to use Core CLR, you should get Desktop flavor, execute ```kpm restore``` and then switch to Core CLR
3. **[Helios]:**
4. ```Helios.cmd``` to launch the app on IISExpress (Application started at URL **http://localhost:5001/**).
4. **[SelfHost]:**
@ -20,20 +24,20 @@ The first thing we need to do is setup the tools required to build and run an ap
6. Run ```k run``` (This hosts the app in a console application - Application started at URL **http://localhost:5003/**)
### Switching between Desktop CLR and CoreCLR:
By default the app runs on desktop CLR. To switch to run the app on CoreCLR set environment variable ```SET TARGET_FRAMEWORK=k10```. To switch back to desktop CLR ```SET TARGET_FRAMEWORK=``` to empty.
By default the app runs on desktop CLR. To switch to run the app on CoreCLR follow the steps below
* On the command line, execute ```kvm install 0.1-alpha-build-0421 -svrc50```
* This command will install core clr flavor of KRE build 0421 and set runtime to core clr 0421 build.
* If you want to run on IIS/IISExpress against core clr, open k.ini and update KRE_FLAVOR to CORECLR and follow steps for running the application from 'Run the application' section
* If you want to run on SelfHost against core clr, follow steps for running the application from 'Run the application' section
### Adding a new package:
1. Edit the project.json to include the package you want to install
2. Do a ```build.cmd``` - This will restore the package and regenerate your csproj files to get intellisense for the installed packages.
1. Edit the project.json to include the package you want to install.
2. Do a ```kpm restore``` - This will restore the package in the project.
### Work against the latest build:
1. Run ```Clean.cmd``` - This will clear all the packages and any temporary files generated
2. Continue the topic "Run the application"
### Work against LKG Build:
1. Everytime you do a ```build.cmd``` you will get the latest packages of all the included packages. If you would like to go back to an LKG build checkout the *LKG.json* file in the MusicStore folder.
2. This is a captured snapshot of build numbers which worked for this application. This LKG will be captured once in a while.
### Note:
1. Application is started on different ports on different hosts. To change the port or URL modify ```Helios.cmd``` or project.json commands section in case of self-host and customhost.
2. Use Visual studio only for editing & intellisense. Don't try to build or run the app from Visual studio.

View File

@ -1,26 +0,0 @@
@echo off
cd %~dp0
SETLOCAL
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
IF EXIST %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"
:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul
:restore
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion
CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86
CALL packages\KoreBuild\build\kvm install default -svrc50 -x86
:run
CALL packages\KoreBuild\build\kvm use default -svr50 -x86
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

187
kvm.cmd
View File

@ -1,187 +0,0 @@
@ECHO OFF
IF "%1"=="" (
CALL :cmd_help
) ELSE (
CALL :cmd_%1 %*
IF ERRORLEVEL 1 CALL:cmd_help
)
GOTO:EOF
:cmd_setup
SET "_KVM_PATH=%USERPROFILE%\.k\"
SET "_TEMP_PATH=%PATH%"
IF /I NOT "%~dp0"=="%_KVM_PATH%" (
IF NOT EXIST "%_KVM_PATH%" MKDIR "%_KVM_PATH%"
COPY "%~f0" "%_KVM_PATH%kvm.cmd"
)
:PARSE_START
@IF "%_TEMP_PATH%"=="" GOTO PARSE_END
@FOR /F "tokens=1* delims=;" %%a in ("%_TEMP_PATH%") Do @IF "%%a"=="%_KVM_PATH%" GOTO:end_setup
@FOR /F "tokens=1* delims=;" %%a in ("%_TEMP_PATH%") Do @SET _TEMP_PATH=%%b
@GOTO PARSE_START
:PARSE_END
SET "PATH=%PATH%;%_KVM_PATH%"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Environment]::SetEnvironmentVariable('PATH',[Environment]::GetEnvironmentVariable('PATH','user')+';%_KVM_PATH%','user');"
:end_setup
CALL "%_KVM_PATH%kvm.cmd" upgrade
@ECHO Running crossgen, see crossgen.log for results
CALL "%_KVM_PATH%k.cmd" crossgen >crossgen.log 2>crossgen.err.log
SET _KVM_PATH=
SET _TEMP_PATH=
GOTO:EOF
:cmd_upgrade
CALL:cmd_install install
CALL:cmd_alias alias default %_KVM_VERSION%
GOTO:EOF
:cmd_install
IF NOT EXIST "%~dp0.nuget\NuGet.exe" (
IF NOT EXIST "%~dp0.nuget" MKDIR "%~dp0.nuget"
ECHO Downloading latest version of NuGet.exe...
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "((new-object net.webclient).DownloadFile('https://nuget.org/nuget.exe', '%~dp0.nuget\NuGet.exe'))"
)
IF NOT EXIST "%~dp0.nuget\NuGet.config" (
echo ^<configuration^> >"%~dp0.nuget\NuGet.config"
echo ^<packageSources^> >>"%~dp0.nuget\NuGet.config"
echo ^<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2" /^> >>"%~dp0.nuget\NuGet.config"
echo ^</packageSources^> >>"%~dp0.nuget\NuGet.config"
echo ^<packageSourceCredentials^> >>"%~dp0.nuget\NuGet.config"
echo ^<AspNetVNext^> >>"%~dp0.nuget\NuGet.config"
echo ^<add key="Username" value="aspnetreadonly" /^> >>"%~dp0.nuget\NuGet.config"
echo ^<add key="ClearTextPassword" value="4d8a2d9c-7b80-4162-9978-47e918c9658c" /^> >>"%~dp0.nuget\NuGet.config"
echo ^</AspNetVNext^> >>"%~dp0.nuget\NuGet.config"
echo ^</packageSourceCredentials^> >>"%~dp0.nuget\NuGet.config"
echo ^</configuration^> >>"%~dp0.nuget\NuGet.config"
)
IF "%2"=="" (
echo Finding latest version
FOR /f "tokens=1,2" %%G in ('"%~dp0.nuget\NuGet.exe" list ProjectK -Prerelease -ConfigFile %~dp0.nuget\NuGet.config') DO (
IF "%%G"=="ProjectK" (
SET _KVM_VERSION=%%H
)
)
) ELSE (
SET "_KVM_VERSION=%2"
)
ECHO Downloading version %_KVM_VERSION%
"%~dp0.nuget\NuGet.exe" install ProjectK -Version %_KVM_VERSION% -OutputDirectory "%~dp0packages" -ConfigFile "%~dp0.nuget\NuGet.config"
CALL:cmd_use use %_KVM_VERSION%
GOTO:EOF
:cmd_use
IF NOT EXIST "%~dp0k.cmd" (
ECHO @CALL %%~dp0kvm.cmd k %%* >%~dp0k.cmd
)
IF EXIST "%~dp0alias\%2.txt" (
FOR /F %%G IN (%~dp0alias\%2.txt) DO (
ECHO Setting _KVM_VERSION to '%%G'
SET "_KVM_VERSION=%%G"
)
) ELSE (
IF NOT EXIST "%~dp0packages\ProjectK.%2\tools\k.cmd" (
ECHO Version '%2' not found.
ECHO You may need to run 'kvm install %2'
GOTO:EOF
)
ECHO Setting _KVM_VERSION to '%2'
SET "_KVM_VERSION=%2"
)
GOTO:EOF
:cmd_alias
IF NOT EXIST "%~dp0alias" (
MKDIR "%~dp0alias"
)
IF "%3"=="" (
IF "%2"=="" (
DIR "%~dp0alias" /b
) ELSE (
ECHO Alias '%2' is
TYPE "%~dp0alias\%2.txt"
)
) ELSE (
IF NOT EXIST "%~dp0packages\ProjectK.%3\tools\k.cmd" (
ECHO Version '%3' not found.
ECHO You may need to run 'kvm install %3'
GOTO:EOF
)
ECHO Setting alias '%2' to '%3'
ECHO %3>%~dp0alias\%2.txt
)
GOTO:EOF
:cmd_list
dir /b "%~dp0packages\ProjectK*"
GOTO:EOF
:cmd_k
@REM find k.cmd in local paths
@REM read _KVM_VERSION.txt if _KVM_VERSION not set
IF "%_KVM_VERSION%" == "" (
FOR /F %%G IN (%~dp0alias\default.txt) DO (
SET "_KVM_VERSION=%%G"
)
)
IF NOT EXIST "%~dp0packages\ProjectK.%_KVM_VERSION%\tools\k.cmd" (
ECHO Version '%_KVM_VERSION%' not found.
ECHO You may need to run 'kvm install %_KVM_VERSION%'
) ELSE (
CALL "%~dp0packages\ProjectK.%_KVM_VERSION%\tools\k.cmd" %2 %3 %4 %5 %6 %7 %8 %9
)
GOTO:EOF
:cmd_help
ECHO kvm ^<command^> [args...]
ECHO k version manager
ECHO .
ECHO kvm help
ECHO displays this help
ECHO .
ECHO kvm upgrade
ECHO install latest k version and make it the default
ECHO .
ECHO kvm install ^<version^>
ECHO install and use specific k version
ECHO .
ECHO kvm list
ECHO list installed k versions
ECHO .
ECHO kvm use ^<version^>^|^<alias^>
ECHO use a version or alias within the current command prompt
ECHO .
ECHO kvm alias ^<alias^> ^<version^>
ECHO create alias to a specific version
ECHO alias names may be passed to 'kvm use ^<alias^>'
ECHO the alias 'default' determines the default k version
ECHO when kvm use is not called
ECHO .
ECHO kvm alias ^<alias^>
ECHO show the version of an alias
ECHO .
ECHO kvm alias
ECHO list aliases
ECHO .
GOTO:EOF

View File

@ -1,7 +0,0 @@
var VERSION='0.1'
var FULL_VERSION='0.1'
var AUTHORS='Microsoft'
use-standard-lifecycle
k-standard-goals

View File

@ -1,62 +0,0 @@
{
"version": "0.1-alpha-*",
"dependencies": {
"Helios": "0.1-alpha-build-0489",
"Microsoft.AspNet.Http": "0.1-alpha-381",
"Microsoft.AspNet.Mvc": "0.1-alpha-build-1047",
"Microsoft.AspNet.Razor": "0.1-alpha-187",
"Microsoft.Framework.ConfigurationModel": "0.1-alpha-214",
"Microsoft.Framework.DependencyInjection": "0.1-alpha-build-0345",
"Microsoft.AspNet.RequestContainer": "0.1-alpha-build-0477",
"Microsoft.AspNet.Routing": "0.1-alpha-build-0478",
"Microsoft.AspNet.Mvc.ModelBinding": "0.1-alpha-build-1047",
"Microsoft.AspNet.Mvc.Core": "0.1-alpha-build-1047",
"Microsoft.AspNet.Mvc.Razor": "0.1-alpha-build-1047",
"Microsoft.AspNet.StaticFiles": "0.1-alpha-build-0367",
"System.Security.Claims": "0.1-alpha-build-0230",
"System.Security.Principal": "4.0.0.0",
"Microsoft.AspNet.Security.DataProtection": "0.1-alpha-148",
"Microsoft.AspNet.Identity": "0.1-alpha-build-0805",
"Microsoft.AspNet.Identity.Entity": "0.1-alpha-build-0805",
"Microsoft.AspNet.Identity.InMemory": "0.1-alpha-build-0805",
"Microsoft.AspNet.Identity.Security": "0.1-alpha-build-0805",
"Microsoft.Data.Entity": "0.1-alpha-build-0686",
"Microsoft.Data.Entity.Relational": "0.1-alpha-build-0686",
"Microsoft.Data.Entity.SqlServer": "0.1-alpha-build-0686",
"Microsoft.Data.Entity.InMemory": "0.1-alpha-build-0686",
"Microsoft.Data.Entity.Migrations": "0.1-alpha-build-0686",
"Microsoft.AspNet.Diagnostics": "0.1-alpha-build-0522",
"Microsoft.AspNet.Hosting": "0.1-alpha-build-0477",
"Microsoft.AspNet.Server.WebListener": "0.1-alpha-build-0423",
"Microsoft.Framework.ConfigurationModel.Json": "0.1-alpha-214",
"Microsoft.AspNet.Security": "0.1-alpha-build-0401",
"Microsoft.AspNet.Security.Cookies": "0.1-alpha-build-0401"
},
"configurations": {
"net45": {
"dependencies": {
"System.Runtime": "",
"System.ComponentModel.DataAnnotations": "",
"System.Data": ""
}
},
"k10": {
"dependencies": {
"System.Collections": "4.0.0.0",
"System.Linq": "4.0.0.0",
"System.Runtime": "4.0.20.0",
"System.Runtime.Extensions": "4.0.10.0",
"System.Dynamic.Runtime": "4.0.0.0",
"System.Threading.Tasks": "4.0.10.0",
"System.ComponentModel": "4.0.0.0",
"System.Console": "4.0.0.0",
"System.Diagnostics.Debug": "4.0.10.0",
"System.Diagnostics.Tools": "4.0.0.0",
"Microsoft.DataAnnotations": "0.1-alpha-build-0097",
"System.Reflection": "4.0.10.0",
"System.Reflection.Extensions": "4.0.0.0",
"System.IO": "4.0.0.0"
}
}
}
}

View File

@ -1,2 +1,2 @@
KRE_VERSION=0.1-alpha-build-0420
KRE_FLAVOR=CORECLR
KRE_VERSION=0.1-alpha-build-0421
KRE_FLAVOR=DESKTOP