-
Notifications
You must be signed in to change notification settings - Fork 37
fixed xamarin build command #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cmd/xamarin.go
Outdated
| continue | ||
|
|
||
| if enableVerboseLog { | ||
| xamSlnJSON, err := json.MarshalIndent(xamSln, "", "\t") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd/xamarin.go
Outdated
| if enableVerboseLog { | ||
| xamSlnJSON, err := json.MarshalIndent(xamSln, "", "\t") | ||
| if err == nil { | ||
| log.Debugf("xamSln:\n%s", xamSlnJSON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't abbreviate in debug log (xamSln)
cmd/xamarin.go
Outdated
| continue | ||
| } | ||
|
|
||
| archivableProjectConfigNames := []string{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd/xamarin.go
Outdated
| ) | ||
| archivableSolutionConfigNameMap := map[string]bool{} | ||
| for _, project := range xamSln.ProjectMap { | ||
| if project.SDK != constants.SDKIOS { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if project.SDK != constants.SDKIOS || project.OutputType != "exe" {
continue
}
cmd/xamarin.go
Outdated
| } | ||
|
|
||
| archivableProjectConfigNames := []string{} | ||
| for configName, config := range project.Configs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name, config, or name, c
https://github.com/golang/go/wiki/CodeReviewComments#variable-names
cmd/xamarin.go
Outdated
| return printXamarinScanFinishedWithError( | ||
| "No acceptable Project found in the provided Solution, or none can be used for iOS Archive.", | ||
| ) | ||
| archivableSolutionConfigNameMap := map[string]bool{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable name should imply that it is a set
cmd/xamarin.go
Outdated
| return printXamarinScanFinishedWithError( | ||
| "No acceptable Project found in the provided Solution, or none can be used for iOS Archive.", | ||
| ) | ||
| archivableSolutionConfigNameMap := map[string]bool{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from line 82 to 113 could be a separate function:
func archivableSolutionConfigNames(map[string]project.Model) []stringand call with
archivableSolutionConfigNames(xamSln.ProjectMap)
xamarin/xamarin.go
Outdated
| projectName := strings.Replace(xamarinCmd.ProjectName, ".", "_", -1) | ||
|
|
||
| archivesBeforeBuild, err := listArchives() | ||
| builder, err := builder.New(xamarinCmd.SolutionFilePath, []constants.SDK{constants.SDKIOS}, buildtools.Msbuild) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
builder variable shadowing builder package
xamarin/xamarin.go
Outdated
| cmd, err := command.NewFromSlice(cmdArgs) | ||
| if err != nil { | ||
| return "", "", fmt.Errorf("Failed to create Xamarin command, error: %s", err) | ||
| callback := func(solutionName string, projectName string, sdk constants.SDK, testFramwork constants.TestFramework, commandStr string, alreadyPerformed bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be defined outside of this function, and use an underscore _ for not used variables.
xamarin/xamarin.go
Outdated
| for _, archiveBeforeBuild := range archivesBeforeBuild { | ||
| if archiveAfterBuild == archiveBeforeBuild { | ||
| isNew = false | ||
| archivesDuringBuild := []string{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd/xamarin.go
Outdated
| } | ||
| } | ||
| if len(archivableSolutionConfigNames) < 1 { | ||
| return printXamarinScanFinishedWithError(`No acceptable Configuration found in the provided Solution and Project, or none can be used for iOS "Archive for Publishing".`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement builtin error interface instead of calling a function which is printing and returning an error.
type ArchiveError struct {
toolName string
msg string
}
func (e ArchiveError) Error() string
No description provided.