Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
176 lines (140 loc) · 7.27 KB
/
Copy pathDirectory.Build.props
File metadata and controls
176 lines (140 loc) · 7.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<Project>
<!-- Directory.Build.props
IMPORTANT:
Some of the conventions used in this file may no longer be valid with
AutoCAD 2025 and 2026 updates that use .NET 10.0. This file was designed
with the assumption that each product release and its updates use the same
framework version, which is no longer the case. Hence constants such as
AUTOCAD_202X_OR_LATER are no longer reliable.
The environment varibles which this code looks for can still be used,
but must point to folders containing assemblies that target the specified
framework versions.
If your objective is to target AutoCAD 2025 or later with a single code
base, you can point the AC_NET_10_REF_PATH environment variable to the
folder containing the AutoCAD 2025 update that uses .NET 10.0. That of
course, assumes that your code is not dependent on changes/additions to
later versions of the AutoCAD .NET API. Then, your build that targets
.NET 8.0 would be used with the initial releases of AutoCAD 2025 and 2026
that target .NET 8.0, and the build that targets .NET 10.0 would be used
with the AutoCAD 2025 and 2026 updates that use .NET 10.0, and AutoCAD 2027.
The .NET 10 updates to AutoCAD 2025 and 2026 also have significant
ramifications on launchSettings.json.
Note that the README.MD file linked to below has not been updated to reflect
these changes.
See https://github.com/ActivistInvestor/AcadMultiTargetExample for prerequisites.
This file requires some or all of the
following environment variables to be defined:
AC_NET_4_REF_PATH (Path to reference assemblies for .NET 4.x / AutoCAD 2020-2024)
AC_NET_8_REF_PATH (Path to reference assemblies for .NET 8.0 / AutoCAD 2025 & 2026)
AC_NET_10_REF_PATH (Path to reference assemblies for .NET 10.0 / AutoCAD 2027+)
AC_NET_4_EXE_PATH (Path to install location of .NET 4.7-based AutoCAD)
AC_NET_8_EXE_PATH (Path to install location of .NET 8.0-based AutoCAD)
AC_NET_10_EXE_PATH (Path to install location of .NET 10.0-based AutoCAD)
Each of the above variables only need to be defined if you
are targeting the associated framework version.
Directory.Build.props, along with Directory.Build.targets
vastly-simplifies the use of Multi-targeting to build multiple
versions of a .NET extension for AutoCAD that each target
different releases of AutoCAD and the .NET Framework versions
they use, within a single project and code base.
See Readme.md for complete documentation and instructions on
how to create a project (or adapt an existing project) to
target multiple AutoCAD product releases and .NET framework
versions.
Important:
Use of this file and Directory.Build.targets requires the
environment variables described above to be set.
-->
<!-- Suppress warnings about conflicts between assembly versions
used by AutoCAD Reference Assemblies, as they are automatically
unified by MSBuild. This is optional, and can be removed if you
want to see the warnings. You can also move it to each project's
csproj file to suppress warnings on a per-project basis.
-->
<PropertyGroup>
<NoWarn>$(NoWarn);MSB3277</NoWarn>
</PropertyGroup>
<!-- Master switch that enables/disables dynamically-generated loader
script and command line arguments that automatically NETLOAD the target
assembly into AutoCAD, and open/load startup .dwg/.dwt/.lsp/.scr files
when a debug session is started.
When set to false, there is no dynamically-generated loader script or
command line arguments required to load it, and no startup files are
automatically opened/loaded.
This an opt-out setting that is opt-in by default. For projects that
are primarily intended to be loaded indirectly by being referenced
from another project, this should be set to false in the .csproj file
to disable dynamic loader script and command line argument generation.
-->
<PropertyGroup Condition="'$(TargetFramework)' != ''">
<DebugStartupProject Condition="'$(DebugStartupProject)' != 'true'">true</DebugStartupProject>
</PropertyGroup>
<!-- <ExecutableName/> property: -->
<!-- The default name of the executable to launch in debug sessions.
Also defines the executable that is killed when the project is built,
if the <KillTargetProcessOnBuild> property is true.
Can be overridden by assigning a different value to this property
in a .csproj file. For example, it can be set to "accoreconsole.exe"
to use AutoCAD Core Console as the debug target. This property is
referenced from launchSettings.json and Directory.Build.targets -->
<PropertyGroup>
<ExecutableName>acad.exe</ExecutableName>
<!-- Used for pre-release Alpha builds that use an App Execution Alias -->
<StartupAppName>acad</StartupAppName>
<!-- The name of the startup folder, which must reside
in the root folder of the project -->
<StartupFolder>Startup</StartupFolder>
</PropertyGroup>
<PropertyGroup>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<!-- Framework / AutoCAD mapping
Defines $(AcRefPath) and other framework-specific properties
based on the current TFM. See Readme.md for a complete explanation
of these properties. These properties will be assigned to different
values depending on what target framework is currently being built.
The $(_Ver) property is primarily for internal use within the included
Directory.Build.targets file, and always holds the same value as the
$(FrameworkMajorVer) property.
-->
<Choose>
<When Condition="'$(TargetFramework)' != ''">
<Choose>
<When Condition="$(TargetFramework.StartsWith('net4'))">
<PropertyGroup Condition="Exists('$(AC_NET_4_REF_PATH)')">
<AcRefPath>$(AC_NET_4_REF_PATH.TrimEnd('\'))'</AcRefPath>
<AcMinVer>2020</AcMinVer>
<AcMaxVer>2024</AcMaxVer>
<FrameworkMajorVer>4</FrameworkMajorVer>
<_Ver>4</_Ver>
<DefineConstants>$(DefineConstants);AUTOCAD_2020_OR_GREATER</DefineConstants>
<!-- Binding Redirects apply to .NET Framework Only -->
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
</When>
<When Condition="$(TargetFramework.StartsWith('net8'))">
<PropertyGroup Condition="Exists('$(AC_NET_8_REF_PATH)')">
<AcRefPath>$(AC_NET_8_REF_PATH.TrimEnd('\'))</AcRefPath>
<AcMinVer>2025</AcMinVer>
<AcMaxVer>2026</AcMaxVer>
<FrameworkMajorVer>8</FrameworkMajorVer>
<_Ver>8</_Ver>
<DefineConstants>$(DefineConstants);AUTOCAD_2020_OR_GREATER;AUTOCAD_2025_OR_GREATER</DefineConstants>
</PropertyGroup>
</When>
<When Condition="$(TargetFramework.StartsWith('net10'))">
<PropertyGroup Condition="Exists('$(AC_NET_10_REF_PATH)')">
<AcRefPath>$(AC_NET_10_REF_PATH.TrimEnd('\'))</AcRefPath>
<FrameworkMajorVer>10</FrameworkMajorVer>
<_Ver>10</_Ver>
<AcMinVer>2027</AcMinVer>
<AcMaxVer>2027</AcMaxVer>
<DefineConstants>$(DefineConstants);AUTOCAD_2020_OR_GREATER;AUTOCAD_2025_OR_GREATER;AUTOCAD_2027_OR_GREATER</DefineConstants>
</PropertyGroup>
</When>
</Choose>
</When>
</Choose>
</Project>