Skip to content

Commit

Permalink
reset loading assemblies from folder
Browse files Browse the repository at this point in the history
  • Loading branch information
alvpickmans committed Jan 19, 2020
1 parent fb2e4c3 commit b560c38
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 54 deletions.
37 changes: 20 additions & 17 deletions PythonConsoleControl/PythonConsoleControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,8 @@
<PackageReference Include="Autodesk.Revit.SDK" Version="2018.*" Condition=" '$(RevitVersion)' == '2018' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.1.0" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
<PackageReference Include="AvalonEdit" Version="6.0.1">
<IncludeAssets></IncludeAssets>
</PackageReference>
<PackageReference Include="IronPython" Version="2.7.9" Condition=" '$(TargetFramework)' != 'net40' ">
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" Condition=" '$(TargetFramework)' != 'net40' ">
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
<PackageReference Include="AvalonEdit" Version="6.0.1"/>

</ItemGroup>

<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
Expand All @@ -116,24 +109,33 @@
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Autodesk.Revit.SDK'" />
</ItemGroup>
</Target>



<!--<ItemGroup Condition=" '$(TargetFramework)' != 'net40' ">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0"/>
<PackageReference Include="IronPython" Version="2.7.9" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0"/>
</ItemGroup>-->

<ItemGroup>
<Reference Include="IronPython" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="IronPython">
<HintPath>..\RequiredLibraries\IronPython.dll</HintPath>
</Reference>
<Reference Include="IronPython.Modules" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="IronPython.Modules">
<HintPath>..\RequiredLibraries\IronPython.Modules.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Dynamic" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.Dynamic">
<HintPath>..\RequiredLibraries\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.Scripting">
<HintPath>..\RequiredLibraries\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting.Metadata" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.Scripting.Metadata">
<HintPath>..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
</Reference>
</Reference>
</ItemGroup>


<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
Expand Down Expand Up @@ -173,6 +175,7 @@
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

<!--
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions RevitPythonShell/Manifests/SetupRPSTemplate.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Source: "{OUTDIR}PythonConsoleControl.dll"; DestDir: "{app}"; Flags: replacesame
Source: "{OUTDIR}RevitPythonShell.dll"; DestDir: "{app}"; Flags: replacesameversion
Source: "{OUTDIR}RpsRuntime.dll"; DestDir: "{app}"; Flags: replacesameversion
Source: "{OUTDIR}RevitPythonShell.addin"; DestDir: "{userappdata}\Autodesk\Revit\Addins\{REVIT_VERSION}"; Flags: replacesameversion
Source: "{OUTDIR}ICSharpCode.AvalonEdit.dll"; DestDir: "{app}"
Source: "{OUTDIR}IronPython.dll"; DestDir: "{app}"
Source: "{OUTDIR}IronPython.Modules.dll"; DestDir: "{app}"
Source: "{OUTDIR}Microsoft.Scripting.Metadata.dll"; DestDir: "{app}"
Source: "{OUTDIR}Microsoft.Dynamic.dll"; DestDir: "{app}"
Source: "{OUTDIR}Microsoft.Scripting.dll"; DestDir: "{app}"
Source: "{OUTDIR}DefaultConfig\RevitPythonShell.xml"; DestDir: "{userappdata}\RevitPythonShell\{REVIT_VERSION}"; Flags: onlyifdoesntexist
Source: "{OUTDIR}DefaultConfig\init.py"; DestDir: {userappdata}\RevitPythonShell\{REVIT_VERSION}; Flags: confirmoverwrite;
Source: "{OUTDIR}DefaultConfig\startup.py"; DestDir: {userappdata}\RevitPythonShell\{REVIT_VERSION}; Flags: confirmoverwrite;
Expand Down
48 changes: 30 additions & 18 deletions RevitPythonShell/RevitPythonShell.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
-->
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471</TargetFrameworks>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug One'">
Expand Down Expand Up @@ -86,7 +88,7 @@
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
<DefineConstants>TRACE;REVIT2020;WINFORMS;DEBUG</DefineConstants>
<DebugType>full</DebugType>
<OutputPath></OutputPath>
<OutputPath>.\bin\$(Configuration)\$(RevitVersion)</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug One|net471|x64'">
Expand All @@ -106,15 +108,7 @@
<PackageReference Include="Autodesk.Revit.SDK" Version="2018.*" Condition=" '$(RevitVersion)' == '2018' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.*" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
<PackageReference Include="AvalonEdit" Version="6.0.1">
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
<PackageReference Include="IronPython" Version="2.7.9" Condition=" '$(TargetFramework)' != 'net40' ">
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" Condition=" '$(TargetFramework)' != 'net40' ">
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
</ItemGroup>

<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
Expand All @@ -123,22 +117,32 @@
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Autodesk.Revit.SDK'" />
</ItemGroup>
</Target>

<!--<ItemGroup Condition=" '$(TargetFramework)' != 'net40' ">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0"/>
<PackageReference Include="IronPython" Version="2.7.9" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0"/>
</ItemGroup>-->

<ItemGroup>
<Reference Include="IronPython" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="IronPython">
<HintPath>..\RequiredLibraries\IronPython.dll</HintPath>
</Reference>
<Reference Include="IronPython.Modules" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="IronPython.Modules">
<HintPath>..\RequiredLibraries\IronPython.Modules.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Dynamic" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.Dynamic">
<HintPath>..\RequiredLibraries\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.Scripting">
<HintPath>..\RequiredLibraries\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting.Metadata" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.Scripting.Metadata">
<HintPath>..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
Expand Down Expand Up @@ -241,8 +245,16 @@
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PythonConsoleControl\PythonConsoleControl.csproj" />
<ProjectReference Include="..\RpsRuntime\RpsRuntime.csproj" />
<ProjectReference Include="..\PythonConsoleControl\PythonConsoleControl.csproj">
<Private>true</Private>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<IncludeAssets>all</IncludeAssets>
</ProjectReference>
<ProjectReference Include="..\RpsRuntime\RpsRuntime.csproj">
<Private>true</Private>
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<IncludeAssets>all</IncludeAssets>
</ProjectReference>
</ItemGroup>

<Target Name="CreateAddinManifest" AfterTargets="AfterBuild">
Expand Down Expand Up @@ -309,7 +321,7 @@
</Task>
</UsingTask>

<Target Name="CopyAddinsToAppData" AfterTargets="CreateAddinManifest" Condition="$(Configuration.Contains('Debug'))">
<Target Name="CopyAddinsToAppData" AfterTargets="CreateAddinManifest">
<!-- Copy newly compiled add-in files to AppData folder (before starting the debugger) -->
<Message Importance="high" Text="Copying addin file into Revit Addin folder" />
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion RevitPythonShell/RevitPythonShellApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Result IExternalApplication.OnStartup(UIControlledApplication application)
#else
dllfolder = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
APP_NAME + versionNumber);
$"{APP_NAME}/{versionNumber}");
#endif
var assemblyName = "CommandLoaderAssembly";
var dllfullpath = Path.Combine(dllfolder, assemblyName + ".dll");
Expand Down
36 changes: 18 additions & 18 deletions RpsRuntime/RpsRuntime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
e.g. if you want to debug ONLY Revit 2019,
put net47 below and switch to 'Debug One' configuration
-->
<TargetFrameworks>net40</TargetFrameworks>
<TargetFrameworks>net471</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net40' ">
Expand Down Expand Up @@ -103,16 +103,7 @@
<PackageReference Include="Autodesk.Revit.SDK" Version="2018.*" Condition=" '$(RevitVersion)' == '2018' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.1.0" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
<PackageReference Include="AvalonEdit" Version="5.0.4">
<IncludeAssets>all</IncludeAssets>
</PackageReference>
<PackageReference Include="IronPython" Version="2.7.9" Condition=" '$(TargetFramework)' != 'net40' ">
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" Condition=" '$(TargetFramework)' != 'net40' ">
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" Condition=" '$(TargetFramework)' != 'net40' " />
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
</ItemGroup>

<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
Expand All @@ -121,26 +112,35 @@
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Autodesk.Revit.SDK'" />
</ItemGroup>
</Target>


<!--<ItemGroup Condition=" '$(TargetFramework)' != 'net40' ">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0"/>
<PackageReference Include="IronPython" Version="2.7.9" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0"/>
</ItemGroup>-->

<ItemGroup>
<Reference Include="IronPython" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="IronPython">
<HintPath>..\RequiredLibraries\IronPython.dll</HintPath>
</Reference>
<Reference Include="IronPython.Modules" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="IronPython.Modules">
<HintPath>..\RequiredLibraries\IronPython.Modules.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Dynamic" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.Dynamic">
<HintPath>..\RequiredLibraries\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.Scripting">
<HintPath>..\RequiredLibraries\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting.Metadata" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.Scripting.Metadata">
<HintPath>..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="Microsoft.CSharp">
<HintPath>..\RequiredLibraries\Microsoft.CSharp.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down

0 comments on commit b560c38

Please sign in to comment.