Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Add command installs automatically when single project is found and d…
Browse files Browse the repository at this point in the history
…isplays a warning when multiple projects are found but interactive command is not given
  • Loading branch information
devboy committed Mar 2, 2015
1 parent 50adf21 commit 1b0ec87
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 0.0.13 - February 26 2015
* Add command installs automatically when single project is found and displays a warning when multiple projects are found but interactive command is not given

#### 0.0.12 - February 26 2015
* Implements Add command

Expand Down
19 changes: 0 additions & 19 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,25 +172,6 @@ Target "MergeExe" (fun _ ->
if result <> 0 then failwithf "Error during ILRepack execution."
)


//Target "MergeExe" (fun _ ->
// CreateDir "bin/merge"
//
// let toPack =
// ["paket.unity3d.exe"; "Paket.Core.dll"; "Ionic.Zip.dll"; "Newtonsoft.Json.dll";]
// |> List.map (fun l -> "bin" @@ l)
// |> separated " "
//
// let result =
// ExecProcess (fun info ->
// info.FileName <- currentDirectory @@ "tools" @@ "ILRepack" @@ "ILRepack.exe"
// info.Arguments <- sprintf "/internalize /verbose /lib:%s /ver:%s /out:%s %s" "bin" release.AssemblyVersion ("bin" @@ "merge" @@ "paket.unity3d.exe") toPack
// info.ErrorDialog <- true
// ) (TimeSpan.FromMinutes 5.)
//
// if result <> 0 then failwithf "Error during ILRepack execution."
//)

// --------------------------------------------------------------------------------------
// Build a NuGet package

Expand Down
19 changes: 14 additions & 5 deletions src/Paket.Unity3D/AddProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ open System.IO
open Paket.Domain
open Paket.Unity3D

let private add (project:DirectoryInfo) package =
UnityProject.FindOrCreateReferencesFile(project)
.AddNuGetReference(package)
.Save()

let Add(dependenciesFileName, package, version, force, hard, interactive, installAfter) =
let existingDependenciesFile = DependenciesFile.ReadFromFile(dependenciesFileName)

Expand All @@ -22,13 +27,17 @@ let Add(dependenciesFileName, package, version, force, hard, interactive, instal

//let lockFile = UpdateProcess.SelectiveUpdate(dependenciesFile,Some(NormalizedPackageName package),force)

let projects = UnityProject.FindAllProjects(Path.GetDirectoryName lockFile.FileName)

if interactive then
let projects = UnityProject.FindAllProjects(Path.GetDirectoryName lockFile.FileName)
for project in projects do
if Utils.askYesNo(sprintf " Add to %s?" project.Name) then
UnityProject.FindOrCreateReferencesFile(project)
.AddNuGetReference(package)
.Save()
if Utils.askYesNo(sprintf " Add package to UnityProject: %s at %s?" project.Name project.Parent.FullName) then
add project package
else if projects.Length=1 then
add projects.[0] package
else if projects.Length > 1 then
Paket.Logging.traceWarn "More than one unity project was found, please run interactive mode (--interactive) to pick and choose target project(s)"


// if installAfter then
// let sources = dependenciesFile.GetAllPackageSources()
Expand Down

0 comments on commit 1b0ec87

Please sign in to comment.