Skip to content

Commit

Permalink
Update nuget package ref #267
Browse files Browse the repository at this point in the history
  • Loading branch information
dukus committed Sep 3, 2017
1 parent cb7ba2b commit f626b31
Show file tree
Hide file tree
Showing 10 changed files with 232 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .nuget/NuGet.Config
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
Binary file added .nuget/NuGet.exe
Binary file not shown.
144 changes: 144 additions & 0 deletions .nuget/NuGet.targets
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>

<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>

<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>

<!-- Determines if package restore consent is required to restore packages -->
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>

<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
</PropertyGroup>

<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
<!--
<PackageSource Include="https://www.nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
-->
</ItemGroup>

<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
</PropertyGroup>

<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
</PropertyGroup>

<PropertyGroup>
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
</PropertyGroup>

<PropertyGroup>
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
</PropertyGroup>

<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>

<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>

<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>

<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>

<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>

<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>

<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(BuildDependsOn);
</BuildDependsOn>

<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
$(BuildDependsOn);
BuildPackage;
</BuildDependsOn>
</PropertyGroup>

<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
<!--
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
This effectively acts as a lock that makes sure that the download operation will only happen once and all
parallel builds will have to wait for it to complete.
-->
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
</Target>

<Target Name="_DownloadNuGet">
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
</Target>

<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />

<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
</Target>

<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />

<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Condition=" '$(OS)' == 'Windows_NT' " />
</Target>

<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Net" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
</Project>
Binary file added CameraControl.Devices.2.0.73-beta.nupkg
Binary file not shown.
43 changes: 43 additions & 0 deletions CameraControl.Devices.nuspec
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>CameraControl.Devices</id>
<version>2.0.73-beta</version>
<title>digiCamControl</title>
<authors>Duka Istvan</authors>
<owners>Duka Istvan</owners>
<licenseUrl>https://raw.githubusercontent.com/dukus/digiCamControl/master/CameraControl.Application/Licenses/DigiCamControlLicence.txt</licenseUrl>
<projectUrl>https://github.com/dukus/digiCamControl</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Library to control Canon,Sony,Nikon DSLR cameras</description>
<releaseNotes />
<tags>camera control nikon canon sony dslr live view</tags>
<dependencies>
<group targetFramework=".NETFramework4.6">
<dependency id="Newtonsoft.Json" version="10.0.3" />
<dependency id="WebSocketSharp" version="1.0.3-rc11" />
<dependency id="Rssdp" version="2.0.9" />
</group>
</dependencies>
<contentFiles>
<files include="CameraControl\bin\Debug\EDSDK.dll" buildAction="None" copyToOutput="true" flatten="true" />
<files include="CameraControl\bin\Debug\EdsImage.dll" buildAction="None" copyToOutput="true" flatten="true" />
</contentFiles>
</metadata>
<files>
<file src="CameraControl\bin\Debug\CameraControl.Devices.dll" target="lib\net46\CameraControl.Devices.dll" />
<file src="CameraControl\bin\Debug\CameraControl.Devices.pdb" target="lib\net46\CameraControl.Devices.pdb" />
<file src="CameraControl\bin\Debug\Canon.Eos.Framework.dll" target="lib\net46\Canon.Eos.Framework.dll" />
<file src="CameraControl\bin\Debug\Canon.Eos.Framework.pdb" target="lib\net46\Canon.Eos.Framework.pdb" />
<file src="CameraControl\bin\Debug\Interop.PortableDeviceApiLib.dll" target="lib\net46\Interop.PortableDeviceApiLib.dll" />
<file src="CameraControl\bin\Debug\Interop.PortableDeviceTypesLib.dll" target="lib\net46\Interop.PortableDeviceTypesLib.dll" />
<file src="refs\Interop.WIA.dll" target="lib\net46\Interop.WIA.dll" />
<file src="CameraControl\bin\Debug\PortableDeviceLib.dll" target="lib\net46\PortableDeviceLib.dll" />
<file src="CameraControl\bin\Debug\PortableDeviceLib.pdb" target="lib\net46\PortableDeviceLib.pdb" />
<file src="CameraControl\bin\Debug\PortableDeviceLib.dll" target="lib\net46\PortableDeviceLib.dll" />
<file src="CameraControl\bin\Debug\PortableDeviceLib.pdb" target="lib\net46\PortableDeviceLib.pdb" />
<file src="tools\install.ps1" target="tools\install.ps1" />
<file src="CameraControl\bin\Debug\EDSDK.dll" target="content\EDSDK.dll"/>
<file src="CameraControl\bin\Debug\EdsImage.dll" target="content\EdsImage.dll"/>
</files>
</package>
8 changes: 4 additions & 4 deletions CameraControl.Devices/Canon/CanonSDKBase.cs
Expand Up @@ -1057,10 +1057,10 @@ private void Mode_ValueChanged(object sender, string key, long val)
try
{
Camera.SetProperty(Edsdk.PropID_AEModeSelect, val);
Camera.SetProperty(Edsdk.PropID_AEMode, val);
Thread.Sleep(200);
ReInitFNumber(true);
ReInitShutterSpeed();
//Camera.SetProperty(Edsdk.PropID_AEMode, val);
//Thread.Sleep(200);
//ReInitFNumber(true);
//ReInitShutterSpeed();
}
catch (Exception exception)
{
Expand Down
1 change: 1 addition & 0 deletions CameraControl.sln.DotSettings.user
Expand Up @@ -10,6 +10,7 @@
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue">&lt;AssemblyExplorer&gt;&#xD;
&lt;Assembly Path="d:\devel\vs2010\CameraControl\packages\ImageLibrary.2.0.5\lib\net45\Kaliko.ImageLibrary.dll" /&gt;&#xD;
&lt;/AssemblyExplorer&gt;</s:String>
<s:Int64 x:Key="/Default/Environment/SearchAndNavigation/DefaultOccurrencesGroupingIndex/@EntryValue">2</s:Int64>



Expand Down
7 changes: 1 addition & 6 deletions Setup/wix/Setup.g.wxs
Expand Up @@ -23,10 +23,6 @@
<RemoveFolder Id="INSTALLDIR" On="uninstall" />
</Component>

<Component Id="Component.CLRHost.Interop.dll" Guid="357e0d80-5093-478e-8c11-28b147c75965">
<File Id="CLRHost.Interop.dll" Source="ObsPlugin\CLRHostPlugin\CLRHost.Interop.dll" />
</Component>

<Component Id="Component.DccObsPlugin.dll" Guid="357e0d80-5093-478e-8c11-28b1a46c7edd">
<File Id="DccObsPlugin.dll" Source="ObsPlugin\CLRHostPlugin\DccObsPlugin.dll" />
</Component>
Expand All @@ -39,7 +35,7 @@

<PropertyRef Id="NETFRAMEWORK45" />

<WixVariable Id="WixUILicenseRtf" Value="f:\devel\vs2010\CameraControl\CameraControl\bin\Debug\Licenses\DigiCamControlLicence.rtf" />
<WixVariable Id="WixUILicenseRtf" Value="d:\devel\vs2010\CameraControl\CameraControl\bin\Debug\Licenses\DigiCamControlLicence.rtf" />

<Upgrade Id="357e0d80-5093-478e-8c11-28b1a72096e7">
<UpgradeVersion Minimum="0.0.0.0" Maximum="2.0.73.5" IncludeMinimum="yes" IncludeMaximum="no" Property="UPGRADEFOUND" />
Expand All @@ -56,7 +52,6 @@

<Feature Id="Obs_Plugin" Title="Obs Plugin" Absent="allow" Level="1">
<ComponentRef Id="Component.INSTALLDIR" />
<ComponentRef Id="Component.CLRHost.Interop.dll" />
<ComponentRef Id="Component.DccObsPlugin.dll" />
</Feature>

Expand Down
2 changes: 2 additions & 0 deletions build.bat
@@ -0,0 +1,2 @@
.nuget\NuGet.exe pack
pause
31 changes: 31 additions & 0 deletions tools/install.ps1
@@ -0,0 +1,31 @@
param($installPath, $toolsPath, $package, $project)

$project.Object.References | Where-Object { $_.Name -eq "Interop.WIA" } | ForEach-Object { $_.EmbedInteropTypes = $false }
$project.Object.References | Where-Object { $_.Name -eq "Interop.PortableDeviceApiLib" } | ForEach-Object { $_.EmbedInteropTypes = $false }
$project.Object.References | Where-Object { $_.Name -eq "Interop.PortableDeviceTypesLib" } | ForEach-Object { $_.EmbedInteropTypes = $false }

$configItem = $project.ProjectItems.Item("EDSDK.dll")

# set 'Copy To Output Directory' to 'Copy if newer'
$copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory")

# Copy Always Always copyToOutput.Value = 1
# Copy if Newer copyToOutput.Value = 2
$copyToOutput.Value = 2

# set 'Build Action' to 'Content'
$buildAction = $configItem.Properties.Item("BuildAction")
$buildAction.Value = 2

$configItem = $project.ProjectItems.Item("EdsImage.dll")

# set 'Copy To Output Directory' to 'Copy if newer'
$copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory")

# Copy Always Always copyToOutput.Value = 1
# Copy if Newer copyToOutput.Value = 2
$copyToOutput.Value = 2

# set 'Build Action' to 'Content'
$buildAction = $configItem.Properties.Item("BuildAction")
$buildAction.Value = 2

0 comments on commit f626b31

Please sign in to comment.