-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from opengapps:update-deps-gapps
Update deps, switch to own gapps package
- Loading branch information
Showing
18 changed files
with
514 additions
and
159 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 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 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,87 @@ | ||
//go:generate enumer -type=Android -json -transform=snake -trimprefix=Android | ||
//go:generate enumer -type=Platform -json -transform=snake -trimprefix=Platform | ||
//go:generate enumer -type=Variant -json -transform=snake -trimprefix=Variant | ||
|
||
package gapps | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// Platform is an enum for different chip architectures | ||
type Platform uint | ||
|
||
// Platform consts | ||
const ( | ||
PlatformArm Platform = iota | ||
PlatformArm64 | ||
PlatformX86 | ||
PlatformX86_64 | ||
) | ||
|
||
// Android is an enum for different Android versions | ||
type Android uint | ||
|
||
// Android consts | ||
const ( | ||
Android44 Android = iota | ||
Android50 | ||
Android51 | ||
Android60 | ||
Android70 | ||
Android71 | ||
Android80 | ||
Android81 | ||
Android90 | ||
Android100 | ||
Android110 | ||
) | ||
|
||
// HumanString is required for human-readable Android version with . delimiter | ||
func (a Android) HumanString() string { | ||
result := a.String() | ||
return result[:len(result)-1] + "." + result[len(result)-1:] | ||
} | ||
|
||
// Variant is an enum for different package variations | ||
type Variant uint | ||
|
||
// Variant consts | ||
const ( | ||
VariantTvstock Variant = iota | ||
VariantPico | ||
VariantNano | ||
VariantMicro | ||
VariantMini | ||
VariantFull | ||
VariantStock | ||
VariantSuper | ||
VariantAroma | ||
VariantTvmini | ||
) | ||
|
||
const parsingErrText = "parsing error: %w" | ||
|
||
// ParsePackageParts helps to parse package info args into proper parts | ||
func ParsePackageParts(args []string) (Platform, Android, Variant, error) { | ||
if len(args) != 3 { | ||
return 0, 0, 0, fmt.Errorf("bad number of arguments: want 4, got %d", len(args)) | ||
} | ||
|
||
platform, err := PlatformString(args[0]) | ||
if err != nil { | ||
return 0, 0, 0, fmt.Errorf(parsingErrText, err) | ||
} | ||
|
||
android, err := AndroidString(args[1]) | ||
if err != nil { | ||
return 0, 0, 0, fmt.Errorf(parsingErrText, err) | ||
} | ||
|
||
variant, err := VariantString(args[2]) | ||
if err != nil { | ||
return 0, 0, 0, fmt.Errorf(parsingErrText, err) | ||
} | ||
|
||
return platform, android, variant, nil | ||
} |
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,3 @@ | ||
module github.com/opengapps/package-api/pkg/gapps | ||
|
||
go 1.13 |
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.