Skip to content

Commit

Permalink
[Build] Create vconf related to .NET as a file in RO location (#5680)
Browse files Browse the repository at this point in the history
* Change the location and value for generating vconf of runtime_version

* [Build] Create vconf related to .NET as a file in RO location
  • Loading branch information
JongHeonChoi authored Oct 31, 2023
1 parent f3d47ed commit 6a36c0c
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packaging/csapi-tizenfx.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
%define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res
%define DOTNET_TOOLS_PATH /usr/share/dotnet.tizen/tools
%define DOTNET_PRELOAD_PATH /usr/share/dotnet.tizen/preload
%define DOTNET_LIBRARY_PATH /usr/share/dotnet.tizen/lib
%define DOTNET_NUGET_SOURCE /nuget

%define TIZEN_NET_RUNTIME_IDENTIFIERS 4.0.0:5.0.0:5.5.0:6.0.0:6.5.0:7.0.0
%define TIZEN_NET_TARGET_FRAMEWORK_MONIKERS tizen10.0:tizen90:tizen80:tizen70:tizen60:tizen50:tizen40
%define TIZEN_NET_RUNTIME_IDENTIFIERS 4.0.0:5.0.0:5.5.0:6.0.0:6.5.0:7.0.0:8.0.0
%define TIZEN_NET_TARGET_FRAMEWORK_MONIKERS tizen11.0:tizen10.0:tizen90:tizen80:tizen70:tizen60:tizen50:tizen40
%define DOTNET_CORE_RUNTIME_VERSION 6.0

%define UPGRADE_SCRIPT_PATH /usr/share/upgrade/scripts

Expand Down Expand Up @@ -180,6 +182,7 @@ mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
mkdir -p %{buildroot}%{DOTNET_TOOLS_PATH}
mkdir -p %{buildroot}%{DOTNET_PRELOAD_PATH}
mkdir -p %{buildroot}%{DOTNET_LIBRARY_PATH}

# Install Runtime Assemblies
install -p -m 644 Artifacts/bin/public/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
Expand Down Expand Up @@ -218,6 +221,11 @@ install -p -m 755 packaging/500.tizenfx_upgrade.sh %{buildroot}%{UPGRADE_SCRIPT_
/usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
/usr/bin/vconftool set -t string db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS} -f
/usr/bin/vconftool set -t string db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS} -f
/usr/bin/vconftool set -t string db/dotnet/runtime_version %{DOTNET_CORE_RUNTIME_VERSION} -f
touch %{buildroot}%{DOTNET_LIBRARY_PATH}/dotnet_vconf.info
echo "db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS}" > %{buildroot}%{DOTNET_LIBRARY_PATH}/dotnet_vconf.info
echo "db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS}" >> %{buildroot}%{DOTNET_LIBRARY_PATH}/dotnet_vconf.info
echo "db/dotnet/runtime_version %{DOTNET_CORE_RUNTIME_VERSION}" >> %{buildroot}%{DOTNET_LIBRARY_PATH}/dotnet_vconf.info

%files
%license LICENSE
Expand Down
8 changes: 8 additions & 0 deletions packaging/csapi-tizenfx.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
%define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res
%define DOTNET_TOOLS_PATH /usr/share/dotnet.tizen/tools
%define DOTNET_PRELOAD_PATH /usr/share/dotnet.tizen/preload
%define DOTNET_LIBRARY_PATH /usr/share/dotnet.tizen/lib
%define DOTNET_NUGET_SOURCE /nuget

%define TIZEN_NET_RUNTIME_IDENTIFIERS @rid_version@
%define TIZEN_NET_TARGET_FRAMEWORK_MONIKERS @tfm_support@
%define DOTNET_CORE_RUNTIME_VERSION @dotnet_core_version@

%define UPGRADE_SCRIPT_PATH /usr/share/upgrade/scripts

Expand Down Expand Up @@ -179,6 +181,7 @@ mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
mkdir -p %{buildroot}%{DOTNET_TOOLS_PATH}
mkdir -p %{buildroot}%{DOTNET_PRELOAD_PATH}
mkdir -p %{buildroot}%{DOTNET_LIBRARY_PATH}

# Install Runtime Assemblies
install -p -m 644 Artifacts/bin/public/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
Expand Down Expand Up @@ -217,6 +220,11 @@ install -p -m 755 packaging/500.tizenfx_upgrade.sh %{buildroot}%{UPGRADE_SCRIPT_
/usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
/usr/bin/vconftool set -t string db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS} -f
/usr/bin/vconftool set -t string db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS} -f
/usr/bin/vconftool set -t string db/dotnet/runtime_version %{DOTNET_CORE_RUNTIME_VERSION} -f
touch %{buildroot}%{DOTNET_LIBRARY_PATH}/dotnet_vconf.info
echo "db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS}" > %{buildroot}%{DOTNET_LIBRARY_PATH}/dotnet_vconf.info
echo "db/dotnet/tizen_tfm_support %{TIZEN_NET_TARGET_FRAMEWORK_MONIKERS}" >> %{buildroot}%{DOTNET_LIBRARY_PATH}/dotnet_vconf.info
echo "db/dotnet/runtime_version %{DOTNET_CORE_RUNTIME_VERSION}" >> %{buildroot}%{DOTNET_LIBRARY_PATH}/dotnet_vconf.info

%files
%license LICENSE
Expand Down
32 changes: 32 additions & 0 deletions packaging/makeruntimeversion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import os
import xml.etree.ElementTree as ET

scrpit_dir = os.path.dirname(os.path.abspath(__file__))
spec_dir = os.path.join(scrpit_dir, "csapi-tizenfx.spec")
nuspec_file = os.path.join(scrpit_dir, "../pkg/Tizen.NET/Tizen.NET.nuspec")
tree = ET.parse(nuspec_file)
root = tree.getroot()

runtime_list = []
for meta_child in root.iter():
if meta_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}metadata":
for depen_child in meta_child:
if depen_child.tag == "{http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd}dependencies":
for group in depen_child:
tfm = group.attrib["targetFramework"].lower()
if tfm.startswith(".net"):
if len(tfm) != 15:
runtime_list.append(tfm.replace(".net", "").strip())

runtime_list = list(set(runtime_list))
runtime_list.sort(reverse=True)

f = open(spec_dir,'r')
origin_data = f.read()
f.close()

new_data = origin_data.replace("@dotnet_core_version@", ':'.join(runtime_list))

f = open(spec_dir, 'w')
f.write(new_data)
f.close()
3 changes: 3 additions & 0 deletions packaging/makespec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ python $SCRIPT_DIR/makerid.py

# Update TFM
python $SCRIPT_DIR/maketfm.py

# Update Runtime Version
python $SCRIPT_DIR/makeruntimeversion.py
Empty file modified packaging/maketfm.py
100644 → 100755
Empty file.

0 comments on commit 6a36c0c

Please sign in to comment.