1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Generate GUID for VS2010 apps

This commit is contained in:
Manuel Pégourié-Gonnard
2014-05-09 12:27:49 +02:00
committed by Paul Bakker
parent cd8f844eb3
commit 41e8b62ebb
45 changed files with 56 additions and 44 deletions

View File

@ -27,7 +27,7 @@
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{54880004-9AA2-434D-A2F0-7F59D6F1536A}</ProjectGuid>
<ProjectGuid><GUID></ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace><APPNAME></RootNamespace>
</PropertyGroup>

View File

@ -8,6 +8,7 @@
use warnings;
use strict;
use Digest::MD5 'md5_hex';
my $vs6_dir = "visualc/VS6";
my $vs6_ext = "dsp";
@ -81,15 +82,26 @@ sub slurp_file {
return $content;
}
sub gen_app_guid {
my ($path) = @_;
my $guid = md5_hex( "PolarSSL:$path" );
$guid =~ s/(.{8})(.{4})(.{4})(.{4})(.{12})/\U{$1-$2-$3-$4-$5}/;
return $guid;
}
sub gen_app {
my ($path, $template, $dir, $ext) = @_;
my $guid = gen_app_guid( $path );
$path =~ s!/!\\!g;
(my $appname = $path) =~ s/.*\\//;
my $content = $template;
$content =~ s/<PATHNAME>/$path/g;
$content =~ s/<APPNAME>/$appname/g;
$content =~ s/<GUID>/$guid/g;
open my $app_fh, '>', "$dir/$appname.$ext";
print $app_fh $content;