-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
2,612 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package client | ||
|
||
import ( | ||
"encoding/xml" | ||
) | ||
|
||
type CompareType int | ||
|
||
const ( | ||
CompareTypePlain CompareType = iota | ||
CompareTypeRegExp | ||
) | ||
|
||
func (t CompareType) String() string { | ||
return [...]string{"PLAIN", "REG_EXP"}[t] | ||
} | ||
|
||
func (t CompareType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { | ||
return e.EncodeElement(t.String(), start) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package client | ||
|
||
import "encoding/xml" | ||
|
||
type GitSCM struct { | ||
XMLName xml.Name `xml:"scm"` | ||
Class string `xml:"class,attr"` | ||
ConfigVersion string `xml:"configVersion"` | ||
UserRemoteConfigs *GitUserRemoteConfigs `xml:"userRemoteConfigs"` | ||
Branches *GitScmBranches `xml:"branches"` | ||
|
||
DoGenerateSubmoduleConfigurations bool `xml:"doGenerateSubmoduleConfigurations"` | ||
// submoduleCfg | ||
// extensions | ||
} | ||
|
||
func NewGitScm() *GitSCM { | ||
return &GitSCM{ | ||
Class: "hudson.plugins.git.GitSCM", | ||
Branches: NewGitScmBranches(), | ||
UserRemoteConfigs: NewGitUserRemoteConfigs(), | ||
} | ||
} | ||
|
||
func (scm *GitSCM) AppendUserRemoteConfig(config *GitUserRemoteConfig) *GitUserRemoteConfigs { | ||
return scm.UserRemoteConfigs.Append(config) | ||
} | ||
|
||
func (scm *GitSCM) AppendBranch(branch *GitScmBranchSpec) *GitScmBranches { | ||
return scm.Branches.Append(branch) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package client | ||
|
||
type GitScmBranchSpec struct { | ||
Id string `xml:"id,attr"` | ||
Name string `xml:"name"` | ||
} | ||
|
||
func NewGitScmBranchSpec() *GitScmBranchSpec { | ||
return &GitScmBranchSpec{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package client | ||
|
||
import ( | ||
"encoding/xml" | ||
) | ||
|
||
type GitScmBranches struct { | ||
XMLName xml.Name `xml:"branches"` | ||
Items *[]*GitScmBranchSpec `xml:"hudson.plugins.git.BranchSpec"` | ||
} | ||
|
||
func NewGitScmBranches() *GitScmBranches { | ||
return &GitScmBranches{ | ||
Items: &[]*GitScmBranchSpec{}, | ||
} | ||
} | ||
|
||
func (branches *GitScmBranches) Append(branch *GitScmBranchSpec) *GitScmBranches { | ||
var newBranchItems []*GitScmBranchSpec | ||
if branches.Items != nil { | ||
newBranchItems = append(*branches.Items, branch) | ||
} else { | ||
newBranchItems = append(newBranchItems, branch) | ||
} | ||
newBranches := NewGitScmBranches() | ||
newBranches.Items = &newBranchItems | ||
return newBranches | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.