()
| 387 | } |
| 388 | |
| 389 | func main() { |
| 390 | ACTVersion := "1.6.0" |
| 391 | fmt.Fprintln(os.Stdout, "Automatic Component Toolkit v"+ACTVersion) |
| 392 | if len(os.Args) < 2 { |
| 393 | log.Fatal("Please run with the Interface Description XML as command line parameter.") |
| 394 | log.Fatal("To specify a path for the generated source code use the optional flag \"-o ABSOLUTE_PATH_TO_OUTPUT_FOLDER\"") |
| 395 | log.Fatal("To create a diff between two versions of an Interface Description XML use the optional flag \"-d OTHER_IDL_FILE\"") |
| 396 | } |
| 397 | if os.Args[1] == "-v" { |
| 398 | fmt.Fprintln(os.Stdout, "Version: "+ACTVersion) |
| 399 | return |
| 400 | } |
| 401 | log.Printf("---------------------------------------\n") |
| 402 | |
| 403 | mode := eACTModeGenerate |
| 404 | outfolderBase, err := os.Getwd() |
| 405 | if err != nil { |
| 406 | log.Fatal(err) |
| 407 | } |
| 408 | diffFile := "" |
| 409 | if len(os.Args) >= 4 { |
| 410 | if os.Args[2] == "-o" { |
| 411 | outfolderBase = os.Args[3] |
| 412 | } |
| 413 | |
| 414 | if os.Args[2] == "-d" { |
| 415 | diffFile = os.Args[3] |
| 416 | mode = eACTModeDiff |
| 417 | } |
| 418 | } |
| 419 | if mode == eACTModeGenerate { |
| 420 | log.Printf("Output directory: " + outfolderBase) |
| 421 | } |
| 422 | |
| 423 | log.Printf("Loading Component Description File") |
| 424 | component, err := ReadComponentDefinition(os.Args[1], ACTVersion) |
| 425 | if err != nil { |
| 426 | log.Fatal(err) |
| 427 | } |
| 428 | |
| 429 | log.Printf("Checking Component Description") |
| 430 | err = component.CheckComponentDefinition() |
| 431 | if err != nil { |
| 432 | log.Fatal(err) |
| 433 | } |
| 434 | |
| 435 | if mode == eACTModeDiff { |
| 436 | log.Printf("Loading Component Description File to compare to") |
| 437 | componentB, err := ReadComponentDefinition(diffFile, ACTVersion) |
| 438 | if err != nil { |
| 439 | log.Fatal(err) |
| 440 | } |
| 441 | log.Printf("Checking Component Description B") |
| 442 | err = componentB.CheckComponentDefinition() |
| 443 | if err != nil { |
| 444 | log.Fatal(err) |
| 445 | } |
| 446 | diff, err := DiffComponentDefinitions(component, componentB) |
nothing calls this directly
no test coverage detected