Skip to content

Commit 155d11f

Browse files
Remove platform flag (#19)
* Explicitly exclude 'Dockerfile' since 'Dockerfile*' not working * Remove platform flag
1 parent b209d82 commit 155d11f

File tree

4 files changed

+10
-106
lines changed

4 files changed

+10
-106
lines changed

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ Options:
5959
Azure IoT Edge Module (C#)
6060
Author: Summer Sun
6161
Options:
62-
-lx|--linux-x64
63-
bool - Optional
64-
Default: true
65-
66-
-wn|--windows-nano
67-
bool - Optional
68-
Default: true
69-
7062
-s|--skipRestore
7163
bool - Optional
7264
Default: false
@@ -81,8 +73,6 @@ Options:
8173
8274
```
8375

84-
Parameter `-lx` means you if want Dockerfile for linux-x64 or not. So does the `-wn` for windows-nano.
85-
8676
Parameter `-s` means if you want to skip the restore of packages referenced in module project.
8777

8878
Parameter `-r` means the Docker repository to host your Azure IoT Edge module.

Test/Test.cs

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,49 +38,23 @@ public Test(DotNetFixture fixture)
3838
this.fixture = fixture;
3939
}
4040

41-
public static Dictionary<string, List<string>> FlagFilesMapping = new Dictionary<string, List<string>>{
42-
{
43-
ArchLinux64, new List<string> {
44-
"Dockerfile",
45-
"Dockerfile.amd64.debug"
46-
}
47-
},
48-
{
49-
ArchWindowsNano, new List<string> {
50-
"Dockerfile"
51-
}
52-
}
53-
};
54-
55-
private static string BeforeEach(string lang, string repository, bool linux64 = true, bool windowsNano = true, bool skipRestore = false)
41+
private static string BeforeEach(string lang, string repository, bool skipRestore = false)
5642
{
5743
var scaffoldName = Path.GetRandomFileName().Replace(".", "").ToString();
58-
var command = "new aziotedgemodule -n " + scaffoldName + " -lang " + lang + " -lx " + linux64 + " -wn " + windowsNano + " -s " + skipRestore + " -r " + repository;
44+
var command = "new aziotedgemodule -n " + scaffoldName + " -lang " + lang + " -s " + skipRestore + " -r " + repository;
5945
Process.Start("dotnet", command).WaitForExit();
6046
return scaffoldName;
6147
}
6248

6349
[Theory]
64-
[InlineData(CSharp, true, true, true)]
65-
[InlineData(CSharp, true, true, false)]
66-
[InlineData(CSharp, true, false, true)]
67-
[InlineData(CSharp, true, false, false)]
68-
[InlineData(CSharp, false, true, true)]
69-
[InlineData(CSharp, false, true, false)]
70-
[InlineData(CSharp, false, false, true)]
71-
[InlineData(CSharp, false, false, false)]
72-
[InlineData(FSharp, true, true, true)]
73-
[InlineData(FSharp, true, true, false)]
74-
[InlineData(FSharp, true, false, true)]
75-
[InlineData(FSharp, true, false, false)]
76-
[InlineData(FSharp, false, true, true)]
77-
[InlineData(FSharp, false, true, false)]
78-
[InlineData(FSharp, false, false, true)]
79-
[InlineData(FSharp, false, false, false)]
80-
public void TestArchitecture(string lang, bool linux64, bool windowsNano, bool skipRestore)
50+
[InlineData(CSharp, true)]
51+
[InlineData(CSharp, false)]
52+
[InlineData(FSharp, true)]
53+
[InlineData(FSharp, false)]
54+
public void TestArchitecture(string lang, bool skipRestore)
8155
{
8256
var repository = "test.azurecr.io/test";
83-
var scaffoldName = BeforeEach(lang, repository, linux64, windowsNano, skipRestore);
57+
var scaffoldName = BeforeEach(lang, repository, skipRestore);
8458
var filesToCheck = new List<string> { ".gitignore", "module.json" };
8559

8660
if (skipRestore)
@@ -101,16 +75,6 @@ public void TestArchitecture(string lang, bool linux64, bool windowsNano, bool s
10175
filesToCheck.AddRange(new List<string> { "Program.fs", scaffoldName + ".fsproj" });
10276
}
10377

104-
if (linux64)
105-
{
106-
filesToCheck.AddRange(FlagFilesMapping[ArchLinux64]);
107-
108-
}
109-
if (windowsNano)
110-
{
111-
filesToCheck.AddRange(FlagFilesMapping[ArchWindowsNano]);
112-
}
113-
11478
foreach (var file in filesToCheck)
11579
{
11680
Assert.True(File.Exists(Path.Combine(scaffoldName, file)));

content/dotnet-template-azure-iot-edge-module/CSharp/.template.config/template.json

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@
1919
}
2020
],
2121
"symbols": {
22-
"linux-x64": {
23-
"type": "parameter",
24-
"datatype": "bool",
25-
"defaultValue": "true"
26-
},
27-
"windows-nano": {
28-
"type": "parameter",
29-
"datatype": "bool",
30-
"defaultValue": "true"
31-
},
3222
"skipRestore": {
3323
"type": "parameter",
3424
"datatype": "bool",
@@ -45,22 +35,7 @@
4535
"exclude": [
4636
".template.config/*",
4737
"bin/**/*",
48-
"obj/**/*",
49-
"Dockerfile*"
50-
],
51-
"modifiers": [
52-
{
53-
"condition": "(windows-nano || linux-x64)",
54-
"include": [
55-
"Dockerfile"
56-
]
57-
},
58-
{
59-
"condition": "(linux-x64)",
60-
"include": [
61-
"Dockerfile.amd64.debug"
62-
]
63-
}
38+
"obj/**/*"
6439
]
6540
}
6641
],

content/dotnet-template-azure-iot-edge-module/FSharp/.template.config/template.json

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@
1919
}
2020
],
2121
"symbols": {
22-
"linux-x64": {
23-
"type": "parameter",
24-
"datatype": "bool",
25-
"defaultValue": "true"
26-
},
27-
"windows-nano": {
28-
"type": "parameter",
29-
"datatype": "bool",
30-
"defaultValue": "true"
31-
},
3222
"skipRestore": {
3323
"type": "parameter",
3424
"datatype": "bool",
@@ -45,22 +35,7 @@
4535
"exclude": [
4636
".template.config/*",
4737
"bin/**/*",
48-
"obj/**/*",
49-
"Dockerfile*"
50-
],
51-
"modifiers": [
52-
{
53-
"condition": "(windows-nano || linux-x64)",
54-
"include": [
55-
"Dockerfile"
56-
]
57-
},
58-
{
59-
"condition": "(linux-x64)",
60-
"include": [
61-
"Dockerfile.amd64.debug"
62-
]
63-
}
38+
"obj/**/*"
6439
]
6540
}
6641
],

0 commit comments

Comments
 (0)