11using Spartacus . Modes . PROXY ;
2- using Spartacus . ProcMon ;
32using Spartacus . Spartacus . CommandLine ;
43using System ;
54using System . IO ;
@@ -42,23 +41,10 @@ protected void CreateSingleSolutionForDLL(string dllPath)
4241
4342 public override void SanitiseAndValidateRuntimeData ( )
4443 {
45- if ( RuntimeData . IsExistingLog )
44+ // dllpath.
45+ if ( String . IsNullOrEmpty ( RuntimeData . DLLPath ) )
4646 {
47- SanitiseExistingLogProcessing ( ) ;
48- }
49- else
50- {
51- SanitiseNewLogProcessing ( ) ;
52- }
53-
54- // Check for CSV output file.
55- if ( String . IsNullOrEmpty ( RuntimeData . CSVFile ) )
56- {
57- throw new Exception ( "--csv is missing" ) ;
58- }
59- else if ( File . Exists ( RuntimeData . CSVFile ) )
60- {
61- Logger . Debug ( "--csv exists and will be overwritten" ) ;
47+ throw new Exception ( "--dllpath is missing, will skip DLL proxy generation" ) ;
6248 }
6349
6450 // Solution folder.
@@ -79,76 +65,5 @@ public override void SanitiseAndValidateRuntimeData()
7965 }
8066 }
8167 }
82-
83- protected void SanitiseExistingLogProcessing ( )
84- {
85- // Check if the PML file exists.
86- if ( String . IsNullOrEmpty ( RuntimeData . PMLFile ) )
87- {
88- throw new Exception ( "--pml is missing" ) ;
89- }
90- else if ( ! File . Exists ( RuntimeData . PMLFile ) )
91- {
92- throw new Exception ( "--pml does not exist: " + RuntimeData . PMLFile ) ;
93- }
94- Logger . Debug ( "--pml is " + RuntimeData . PMLFile ) ;
95- }
96-
97- protected void SanitiseNewLogProcessing ( )
98- {
99- // Check for ProcMon.
100- if ( String . IsNullOrEmpty ( RuntimeData . ProcMonExecutable ) )
101- {
102- throw new Exception ( "--procmon is missing" ) ;
103- }
104- else if ( ! File . Exists ( RuntimeData . ProcMonExecutable ) )
105- {
106- throw new Exception ( "--procmon does not exist: " + RuntimeData . ProcMonExecutable ) ;
107- }
108-
109- // Check for ProcMon config & log file.
110- if ( String . IsNullOrEmpty ( RuntimeData . PMCFile ) )
111- {
112- // Since no --pmc has been passed, it means that we can't load the --pml file automatically from
113- // that configuration. This means that we _must_ have --pml passed here.
114- if ( String . IsNullOrEmpty ( RuntimeData . PMLFile ) )
115- {
116- throw new Exception ( "--pml is missing" ) ;
117- }
118- else if ( File . Exists ( RuntimeData . PMLFile ) )
119- {
120- Logger . Debug ( "--pml exists and will be overwritten" ) ;
121- }
122- }
123- else if ( ! File . Exists ( RuntimeData . PMCFile ) )
124- {
125- // If the argument was passed but does not exist, exit.
126- throw new Exception ( "--pmc does not exist: " + RuntimeData . PMCFile ) ;
127- }
128- else
129- {
130- // If we reach this, it means that --pmc has been passed through and exists.
131- ProcMonPMC pmc = new ( RuntimeData . PMCFile ) ;
132-
133- // If the existing PMC file has no logfile/backing file, check to see if --pml has been set.
134- if ( String . IsNullOrEmpty ( pmc . GetConfiguration ( ) . Logfile ) )
135- {
136- if ( String . IsNullOrEmpty ( RuntimeData . PMLFile ) )
137- {
138- throw new Exception ( "The passed --pmc file that has no log/backing file configured and no --pml argument was passed to set it. " +
139- "Either setup the backing file in the existing PMC file or pass a --pml parameter" ) ;
140- }
141-
142- // Here, the --pmc config has no PML path for log/backing, but we've passed a --pml argument.
143- // Therefore, we'll inject our new PML location into the existing PMC config.
144- RuntimeData . InjectBackingFileIntoConfig = true ;
145- }
146- else
147- {
148- // The PMC file has a backing file, so we don't need the --pml argument.
149- RuntimeData . PMLFile = pmc . GetConfiguration ( ) . Logfile ;
150- }
151- }
152- }
15368 }
15469}
0 commit comments