Skip to content

Commit

Permalink
MSBuild: change targets order to copy model ini files before run the …
Browse files Browse the repository at this point in the history
…model
  • Loading branch information
amc1999 committed Apr 10, 2024
1 parent c41d8fa commit 53bc590
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions props/model-ompp.4.build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -161,41 +161,12 @@
</PropertyGroup>

<!--
ModelPublish
-->

<!-- The following properties help make the ModelPublish target and output more readable. -->
<PropertyGroup>
<PUBLISH_TICKLE>$(MODEL_BIN_DIR)/$(MODEL_NAME).publish.tickle</PUBLISH_TICKLE>
<PUBLISH_SQLITE_REL>$([MSBuild]::MakeRelative($(ProjectDir),$(PUBLISH_SQLITE)))</PUBLISH_SQLITE_REL>
<OM_SQL_DIR_REL>$([MSBuild]::MakeRelative($(ProjectDir),$(OM_SQL_DIR)))</OM_SQL_DIR_REL>
<!-- Replace back slash by forward slash. -->
<OM_SQL_DIR_REL>$(OM_SQL_DIR_REL.Replace(&quot;\&quot;,&quot;/&quot;))</OM_SQL_DIR_REL>
</PropertyGroup>

<Target Name="ModelPublish"
Inputs="@(OMC_SQL_OUTPUTS)"
Outputs="$(PUBLISH_TICKLE)"
AfterTargets="link"
>
<Message Text="$(SQLITE_EXE) $(PUBLISH_SQLITE_REL) &lt; $(OM_SQL_DIR_REL)/sqlite/optional_meta_views_sqlite.sql" />
<Exec Command="$(COMPLETE_SQLITE_EXE) $(PUBLISH_SQLITE_REL) &lt; $(OM_SQL_DIR_REL)/sqlite/optional_meta_views_sqlite.sql" />

<Message Text="$(SQLITE_EXE) $(PUBLISH_SQLITE_REL) &lt; src/$(MODEL_NAME)_optional_views_sqlite.sql" />
<Exec Command="$(COMPLETE_SQLITE_EXE) $(PUBLISH_SQLITE_REL) &lt; src/$(MODEL_NAME)_optional_views_sqlite.sql" />

<Touch Files="$(PUBLISH_TICKLE)"
AlwaysCreate="true"
/>
</Target>

<!--
ModelIniPublish
ModelIniPublish: copy model ini file into model bin diretcory
-->
<Target Name="ModelIniPublish"
Inputs="$(MODEL_INI_PATH)"
Outputs="$(MODEL_BIN_DIR)/$(MODEL_INI)"
AfterTargets="link"
BeforeTargets="ModelPublish"
>
<!-- Skip copy if $(MODEL_INI) is empty or absent. -->
<Message Text="Copy $(MODEL_INI) to $(MODEL_BIN_DIR)" Condition="'$(MODEL_INI)'!='' And Exists('$(MODEL_INI_PATH)')" />
Expand All @@ -208,12 +179,12 @@
</Target>

<!--
ModelMessageIniPublish
ModelMessageIniPublish: copy model translated messages ini file into model bin diretcory
-->
<Target Name="ModelMessageIniPublish"
Inputs="$(MODEL_MSG_INI_OMC_OUT)"
Outputs="$(MODEL_BIN_DIR)/$(MODEL_MSG_INI)"
AfterTargets="link"
BeforeTargets="ModelPublish"
>
<!-- Skip copy if $(MODEL_MSG_INI) is absent. -->
<Message Text="Copy $(MODEL_MSG_INI) to $(MODEL_BIN_DIR)" Condition="Exists('$(MODEL_MSG_INI_OMC_OUT)')" />
Expand All @@ -225,6 +196,35 @@
/>
</Target>

<!--
ModelPublish
-->

<!-- The following properties help make the ModelPublish target and output more readable. -->
<PropertyGroup>
<PUBLISH_TICKLE>$(MODEL_BIN_DIR)/$(MODEL_NAME).publish.tickle</PUBLISH_TICKLE>
<PUBLISH_SQLITE_REL>$([MSBuild]::MakeRelative($(ProjectDir),$(PUBLISH_SQLITE)))</PUBLISH_SQLITE_REL>
<OM_SQL_DIR_REL>$([MSBuild]::MakeRelative($(ProjectDir),$(OM_SQL_DIR)))</OM_SQL_DIR_REL>
<!-- Replace back slash by forward slash. -->
<OM_SQL_DIR_REL>$(OM_SQL_DIR_REL.Replace(&quot;\&quot;,&quot;/&quot;))</OM_SQL_DIR_REL>
</PropertyGroup>

<Target Name="ModelPublish"
Inputs="@(OMC_SQL_OUTPUTS)"
Outputs="$(PUBLISH_TICKLE)"
AfterTargets="link"
>
<Message Text="$(SQLITE_EXE) $(PUBLISH_SQLITE_REL) &lt; $(OM_SQL_DIR_REL)/sqlite/optional_meta_views_sqlite.sql" />
<Exec Command="$(COMPLETE_SQLITE_EXE) $(PUBLISH_SQLITE_REL) &lt; $(OM_SQL_DIR_REL)/sqlite/optional_meta_views_sqlite.sql" />

<Message Text="$(SQLITE_EXE) $(PUBLISH_SQLITE_REL) &lt; src/$(MODEL_NAME)_optional_views_sqlite.sql" />
<Exec Command="$(COMPLETE_SQLITE_EXE) $(PUBLISH_SQLITE_REL) &lt; src/$(MODEL_NAME)_optional_views_sqlite.sql" />

<Touch Files="$(PUBLISH_TICKLE)"
AlwaysCreate="true"
/>
</Target>

<!--
RunModel
-->
Expand Down

0 comments on commit 53bc590

Please sign in to comment.