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

Commit

Permalink
Update assembly info and read version at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Larusso committed Jul 14, 2017
1 parent 0ab3cbf commit 1b233e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/Paket.Unity3D.Bootstrapper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
[assembly: AssemblyTitleAttribute("Paket.Unity3D.Bootstrapper")]
[assembly: AssemblyProductAttribute("Paket.Unity3D")]
[assembly: AssemblyDescriptionAttribute("Piggy-backs ontop of Paket to add dependencies to Unity3D projects")]
[assembly: AssemblyVersionAttribute("0.2.3")]
[assembly: AssemblyFileVersionAttribute("0.2.3")]
[assembly: AssemblyVersionAttribute("0.3.0")]
[assembly: AssemblyFileVersionAttribute("0.3.0")]
namespace System {
internal static class AssemblyVersionInformation {
internal const System.String AssemblyTitle = "Paket.Unity3D.Bootstrapper";
internal const System.String AssemblyProduct = "Paket.Unity3D";
internal const System.String AssemblyDescription = "Piggy-backs ontop of Paket to add dependencies to Unity3D projects";
internal const System.String AssemblyVersion = "0.2.3";
internal const System.String AssemblyFileVersion = "0.2.3";
internal const System.String AssemblyVersion = "0.3.0";
internal const System.String AssemblyFileVersion = "0.3.0";
}
}
8 changes: 4 additions & 4 deletions src/Paket.Unity3D/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("Paket.Unity3D")>]
[<assembly: AssemblyProductAttribute("Paket.Unity3D")>]
[<assembly: AssemblyDescriptionAttribute("Piggy-backs ontop of Paket to add dependencies to Unity3D projects")>]
[<assembly: AssemblyVersionAttribute("0.2.3")>]
[<assembly: AssemblyFileVersionAttribute("0.2.3")>]
[<assembly: AssemblyVersionAttribute("0.3.0")>]
[<assembly: AssemblyFileVersionAttribute("0.3.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "Paket.Unity3D"
let [<Literal>] AssemblyProduct = "Paket.Unity3D"
let [<Literal>] AssemblyDescription = "Piggy-backs ontop of Paket to add dependencies to Unity3D projects"
let [<Literal>] AssemblyVersion = "0.2.3"
let [<Literal>] AssemblyFileVersion = "0.2.3"
let [<Literal>] AssemblyVersion = "0.3.0"
let [<Literal>] AssemblyFileVersion = "0.3.0"
9 changes: 4 additions & 5 deletions src/Paket.Unity3D/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ open System
open Nessos.UnionArgParser

let assembly = Assembly.GetExecutingAssembly()
let fvi = FileVersionInfo.GetVersionInfo(assembly.Location);

Logging.event.Publish
|> Observable.subscribe Logging.traceToConsole
Expand All @@ -19,7 +18,7 @@ Logging.event.Publish
type Command =
| [<First>][<CustomCommandLine("install")>] Install
| [<First>][<CustomCommandLine("add")>] Add
| [<First>][<CustomCommandLine("version")>] VersionCmd
| [<First>][<CustomCommandLine("--version")>] VersionCmd
with
interface IArgParserTemplate with
member __.Usage = ""
Expand Down Expand Up @@ -58,15 +57,15 @@ let args = Environment.GetCommandLineArgs().[1..]
try
match args with
| Command(Install, rest) ->
Logging.tracefn "Paket.Unity3D version %s" fvi.FileVersion
Logging.tracefn "Paket.Unity3D version %s" AssemblyVersionInformation.AssemblyVersion
let results = commandArgs<AddArgs> rest
Paket.Logging.verbose <- results.Contains <@ AddArgs.Verbose @>
let deps = Dependencies.Locate().DependenciesFile |> DependenciesFile.ReadFromFile
let lock = deps.FindLockfile().FullName |> LockFile.LoadFrom
let sources = deps.GetAllPackageSources()
Paket.Unity3D.InstallProcess.Install(sources,InstallerOptions.Default,lock)
| Command(Add, rest) ->
Logging.tracefn "Paket.Unity3D version %s" fvi.FileVersion
Logging.tracefn "Paket.Unity3D version %s" AssemblyVersionInformation.AssemblyVersion
let results = commandArgs<AddArgs> rest
let nuget = results.GetResult <@ AddArgs.Nuget @>
Paket.Logging.verbose <- results.Contains <@ AddArgs.Verbose @>
Expand All @@ -80,7 +79,7 @@ try
let dep = Dependencies.Locate()
Paket.Unity3D.AddProcess.Add(dep.DependenciesFile, Paket.Domain.PackageName packageName, version, force, hard, interactive, noInstall |> not)
| Command(VersionCmd, rest) ->
Logging.tracefn "%s" fvi.FileVersion
Logging.tracefn "%s" AssemblyVersionInformation.AssemblyVersion
| _ -> failwith "Paket.Unity3D does not know that command"
with
| exn when not (exn :? System.NullReferenceException) ->
Expand Down

0 comments on commit 1b233e5

Please sign in to comment.