Skip to content

Commit f6a0429

Browse files
authored
Step 1840 remove xamarin support (#155)
* Update .gitignore * Remove all xamarin related code * Fix typos and lint issues * Update command summaries * Pull latest go-xcode for M1 xcode version parsing fix * Update bitrise-init dependency * Restore command's long description * Update command descriptions
1 parent 8b54958 commit f6a0429

File tree

259 files changed

+15026
-16697
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+15026
-16697
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Identities.p12
33
_bin
44
codesigndoc_exports
55
.gows.user.yml
6-
76
.DS_Store
7+
.idea/

README.md

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22

33
Your friendly iOS Code Signing Doctor.
44

5-
Using this tool is as easy as running `codesigndoc scan` and following the guide
6-
it prints. At the end of the process you'll have all the code signing files
7-
(`.p12` Identity file including the Certificate and Private Key, and the
8-
required Provisioning Profiles) required to do a successful Xcode Archive of
9-
your Xcode project.
5+
`codesigndoc` collects all the code signing files required for
6+
Xcode Archive and IPA export or Xcode Build For Testing action.
107

118
What this tool does:
129

13-
1. Gathers all information required to do a clean Xcode / Xamarin Studio Archive
14-
of your project.
15-
1. Runs a clean Xcode / Xamarin Studio Archive on your project.
16-
1. From the generated xcarchive file it collects the Code Signing settings Xcode
17-
/ Xamarin Studio used during the Archive.
10+
1. Gathers all information required for the specified Xcode action.
11+
1. Runs a clean Xcode Archive or Xcode Build For Testing on your project.
12+
1. From the generated artifact it collects the Code Signing settings Xcode used during the action.
1813
1. Prints the list of required code signing files.
1914
1. Optionally it can also search for, and export these files.
2015

@@ -73,19 +68,6 @@ If the UITest scanner cannot find the desired scheme, follow these steps:
7368
</p>
7469
</details>
7570

76-
77-
#### Xamarin
78-
<details><summary>For Archiving & Exporting IPA for <code>Xamarin</code> project (solution):</summary>
79-
<p>
80-
81-
```
82-
bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-io/codesigndoc/master/_scripts/install_wrap-xamarin.sh)"
83-
```
84-
</p>
85-
</details>
86-
87-
----
88-
8971
### Manual install & run
9072

9173
1. download the current release - it's a single, stand-alone binary
@@ -99,13 +81,12 @@ bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-io/codesigndoc
9981
* if you followed the previous examples:
10082
* Xcode project scanner: `./codesigndoc scan xcode`
10183
* Xcode project scanner for UI test targets: `./codesigndoc scan xcodeuitests`
102-
* Xamarin project scanner: `./codesigndoc scan xamarin`
10384

10485
**Optional xcodebuild flags:**
10586

106-
`-sdk`: If a value is specified for this flag it'll be passed to xcodebuild as the value of the -sdk flag. For more info about the values please see xcodebuild's -sdk flag docs. Example value: iphoneos")
87+
`-sdk`: If a value is specified for this flag it'll be passed to xcodebuild as the value of the `-sdk` flag. For more info about the values please see xcodebuild's `-sdk` flag docs. Example value: `iphoneos`")
10788

108-
`-destination`: The xcodebuild -destination option takes as its argument a destination specifier describing the device (or devices) to use as a destination i.e `generic/platform=iOS`.
89+
`-destination`: The xcodebuild `-destination` option takes as its argument a destination specifier describing the device (or devices) to use as a destination i.e `generic/platform=iOS`.
10990

11091

11192
## Manually finding the required base code signing files for an Xcode project or workspace

_scripts/install_wrap-xamarin.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

_scripts/update_wrapper_versions.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func substituteVersionInfo(tmpl *template.Template, data VersionInfo, targetPth
3030
}
3131

3232
func main() {
33-
log.Infof("Only update wrapper versions when release is availabe.")
33+
log.Infof("Only update wrapper versions when release is available.")
3434

3535
tmpl := template.Must(template.ParseFiles("install_wrap.sh.template"))
3636

@@ -64,14 +64,4 @@ func main() {
6464
); err != nil {
6565
panic(fmt.Sprintf("%s", err))
6666
}
67-
68-
if err := substituteVersionInfo(tmpl,
69-
VersionInfo{
70-
ScanCmd: "xamarin",
71-
Version: version.VERSION,
72-
},
73-
"install_wrap-xamarin.sh",
74-
); err != nil {
75-
panic(fmt.Sprintf("%s", err))
76-
}
7767
}

cmd/root.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ var (
1212
enableVerboseLog = false
1313
)
1414

15-
// RootCmd represents the base command when called without any subcommands
15+
// RootCmd represents the base command when called without any subcommands.
1616
var RootCmd = &cobra.Command{
1717
Use: "codesigndoc",
1818
Short: "Your friendly iOS Code Signing Doctor",
1919
Long: `Your friendly iOS Code Signing Doctor
2020
21-
Using this tool is as easy as running "codesigndoc scan xcode/xamarin" and following the guide it prints.
22-
23-
At the end of the process you'll have all the code signing files
24-
(.p12 Identity file including the Certificate and Private Key,
25-
and the required Provisioning Profiles) required to do a successful Archive of your iOS project.`,
21+
codesigndoc collects all the code signing files required for
22+
Xcode Archive and IPA export or Xcode Build For Testing action.`,
2623

2724
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
2825
log.SetEnableDebugLog(enableVerboseLog)

cmd/scan.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ const (
1616
writeFilesFlag = "write-files"
1717
)
1818

19-
// scanCmd represents the scan command
19+
// scanCmd represents the scan command.
2020
var scanCmd = &cobra.Command{
2121
Use: "scan",
22-
Short: "Scan a project's code signing settings",
23-
Long: `Scan a project's code signing settings,
24-
and export the require code signing files.`,
22+
Short: "Scans the project's code signing settings",
23+
Long: `Scans the project's code signing settings,
24+
and exports the required code signing files.`,
2525
TraverseChildren: true,
2626
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
2727
switch cmd.Flag(writeFilesFlag).Value.String() {
@@ -65,13 +65,13 @@ func init() {
6565
RootCmd.AddCommand(scanCmd)
6666
scanCmd.PersistentFlags().BoolVar(&isAskForPassword, "ask-pass", false, "Ask for .p12 password, instead of using an empty password")
6767
scanCmd.PersistentFlags().BoolVar(&certificatesOnly, "certs-only", false, "Collect Certificates (Identities) only")
68-
scanCmd.PersistentFlags().String(writeFilesFlag, "always", `Set wether to export build logs and codesigning files to the ./codesigndoc_exports directory. Defaults to "always". Valid values: "always", "fallback", "disable".
68+
scanCmd.PersistentFlags().String(writeFilesFlag, "always", `Set whether to export build logs and codesigning files to the ./codesigndoc_exports directory. Defaults to "always". Valid values: "always", "fallback", "disable".
6969
- always: Writes artifacts in every case.
7070
- fallback: Does not write artifacts if the automatic upload option is chosen interactively or by providing the auth-token and app-slug flag. Writes build log only on failure.
7171
- disabled: Do not write any files to the export directory.`)
7272
// Flags used to automatically upload artifacts.
7373
scanCmd.PersistentFlags().StringVar(&personalAccessToken, authTokenFlag, "", `Bitrise personal access token. By default codesigndoc will ask for it interactively.
74-
Will upload codesigning files automatically if provided. Requires the app-slug paramater to be also set.`)
74+
Will upload codesigning files automatically if provided. Requires the app-slug parameter to be also set.`)
7575
scanCmd.PersistentFlags().StringVar(&appSlug, appSlugFlag, "", `Bitrise app slug. By default codesigndoc will ask for it interactively.
7676
Will upload codesigning files automatically if provided. Requires the auth-token parameter to be also set.`)
7777
}
@@ -80,8 +80,7 @@ Will upload codesigning files automatically if provided. Requires the auth-token
8080
type Tool string
8181

8282
const (
83-
toolXcode Tool = "Xcode"
84-
toolXamarin Tool = "Visual Studio"
83+
toolXcode Tool = "Xcode"
8584
)
8685

8786
// ArchiveError ...

cmd/utils.go

Lines changed: 13 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,14 @@ import (
66
"path"
77

88
"github.com/bitrise-io/bitrise-init/scanners/ios"
9-
"github.com/bitrise-io/bitrise-init/scanners/xamarin"
109
"github.com/bitrise-io/go-utils/colorstring"
1110
"github.com/bitrise-io/go-utils/log"
1211
"github.com/bitrise-io/go-utils/pathutil"
1312
"github.com/bitrise-io/goinp/goinp"
1413
)
1514

16-
// projectType enum.
17-
// Could be iOSProjectType = 0
18-
// Or xamarinProjectType = 1
19-
type projectType int
20-
21-
const (
22-
iOSProjectType projectType = iota
23-
xamarinProjectType
24-
)
25-
26-
// Scans the root dir for the provided project files
27-
func scanForProjectFiles(projType projectType) ([]string, error) {
15+
// Scans the root dir for the provided project files.
16+
func scanForProjectFiles() ([]string, error) {
2817
searchDir, err := os.Getwd()
2918
if err != nil {
3019
return nil, err
@@ -35,27 +24,16 @@ func scanForProjectFiles(projType projectType) ([]string, error) {
3524
return nil, fmt.Errorf("failed to search for files in (%s), error: %s", searchDir, err)
3625
}
3726

38-
var paths []string
39-
{
40-
if projType == iOSProjectType {
41-
paths, err = ios.FilterRelevantWorkspaceFiles(fileList)
42-
if err != nil {
43-
return nil, fmt.Errorf("failed to search for workspace files, error: %s", err)
44-
}
27+
paths, err := ios.FilterRelevantWorkspaceFiles(fileList)
28+
if err != nil {
29+
return nil, fmt.Errorf("failed to search for workspace files, error: %s", err)
30+
}
4531

46-
if len(paths) == 0 {
47-
paths, err = ios.FilterRelevantProjectFiles(fileList)
48-
if err != nil {
49-
return nil, fmt.Errorf("failed to search for project files, error: %s", err)
50-
}
51-
}
52-
} else if projType == xamarinProjectType {
53-
paths, err = xamarin.FilterSolutionFiles(fileList)
54-
if err != nil {
55-
return nil, fmt.Errorf("failed to search for solution files, error: %s", err)
56-
}
32+
if len(paths) == 0 {
33+
paths, err = ios.FilterRelevantProjectFiles(fileList)
34+
if err != nil {
35+
return nil, fmt.Errorf("failed to search for project files, error: %s", err)
5736
}
58-
5937
}
6038

6139
if len(paths) == 0 {
@@ -65,12 +43,12 @@ func scanForProjectFiles(projType projectType) ([]string, error) {
6543
return paths, nil
6644
}
6745

68-
// findProject scans the directory for Xcode Project (.xcworkspace / .xcodeproject) file first
69-
// If can't find any, ask the user to drag-and-drop the file
46+
// findProject scans the directory for Xcode Project (.xcworkspace / .xcodeproj) file,
47+
// if can't find any, ask the user to drag-and-drop the file.
7048
func findXcodeProject() (string, error) {
7149
var projpth string
7250

73-
projPaths, err := scanForProjectFiles(iOSProjectType)
51+
projPaths, err := scanForProjectFiles()
7452
if err != nil {
7553
log.Printf("Failed: %s", err)
7654
fmt.Println()
@@ -100,37 +78,3 @@ the one you usually open in Xcode, then hit Enter.
10078

10179
return projpth, nil
10280
}
103-
104-
// findSolution scans the directory for Xamarin.Solution file first
105-
// If can't find any, ask the user to drag-and-drop the file
106-
func findXamarinSolution() (string, error) {
107-
var solutionPth string
108-
solPaths, err := scanForProjectFiles(xamarinProjectType)
109-
if err != nil {
110-
log.Printf("Failed: %s", err)
111-
fmt.Println()
112-
113-
log.Infof("Provide the solution file manually")
114-
askText := `Please drag-and-drop your Xamarin Solution (` + colorstring.Green(".sln") + `) file,
115-
and then hit Enter`
116-
solutionPth, err = goinp.AskForPath(askText)
117-
if err != nil {
118-
return "", fmt.Errorf("failed to read input: %s", err)
119-
}
120-
121-
return solutionPth, nil
122-
}
123-
124-
if len(solPaths) == 1 {
125-
log.Printf("Found one solution file: %s.", path.Base(solPaths[0]))
126-
return solPaths[0], nil
127-
}
128-
129-
log.Printf("Found multiple solution file: %s.", path.Base(solutionPth))
130-
solutionPth, err = goinp.SelectFromStringsWithDefault("Select the solution file you want to scan", 1, solPaths)
131-
if err != nil {
132-
return "", fmt.Errorf("failed to select solution file: %s", err)
133-
}
134-
135-
return solutionPth, nil
136-
}

cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var (
1212
isFullVersionPrint = false
1313
)
1414

15-
// versionCmd represents the version command
15+
// versionCmd represents the version command.
1616
var versionCmd = &cobra.Command{
1717
Use: "version",
1818
Short: "Prints version number",

0 commit comments

Comments
 (0)