From 8e0f32eb5421d71846700ffe4f11d2958a33f1b1 Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Sat, 13 Jan 2018 13:23:39 -0800 Subject: feat(main): support modifying built platforms Bakelite now accepts a platform modification string vita the -platform flag. This string format for adding and removing the built platforms, including removing the default platforms entirely. It is processed left to right. bakelite -platform '-windows +linux/s390x' [packages] Would now build [packages] for all of the default platforms, except for Windows, and also build for the linux/s390x platform. bakelite -platform '- +linux +darwin' [packages] Would now build [packages] for the default platforms of only the Linux and Darwin operating systems. The platform modification string is parsed and turned into calls to a structure following the builder pattern. As the user can now modify the built platforms, Bakelite now exits with a non-zero exit code if any of the platforms fail to build. Change-Id: Iade51e17bbfda4e916394343a5f8cb3208f2b160 --- platforms_defaults.go | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 platforms_defaults.go (limited to 'platforms_defaults.go') diff --git a/platforms_defaults.go b/platforms_defaults.go new file mode 100644 index 0000000..9219071 --- /dev/null +++ b/platforms_defaults.go @@ -0,0 +1,75 @@ +package main + +func defaultDarwin() []Platform { + return []Platform{ + {OS_DARWIN, ARCH_386}, + {OS_DARWIN, ARCH_AMD64}, + //{OS_DARWIN, ARCH_ARM}, + //{OS_DARWIN, ARCH_ARM64}, + } +} + +func defaultDragonfly() []Platform { + return []Platform{ + {OS_DRAGONFLY, ARCH_AMD64}, + } +} + +func defaultFreeBSD() []Platform { + return []Platform{ + {OS_FREEBSD, ARCH_386}, + {OS_FREEBSD, ARCH_AMD64}, + //{OS_FREEBSD, ARCH_ARM}, + } +} + +func defaultLinux() []Platform { + return []Platform{ + {OS_LINUX, ARCH_386}, + {OS_LINUX, ARCH_AMD64}, + //{OS_LINUX, ARCH_ARM}, + //{OS_LINUX, ARCH_ARM64}, + {OS_LINUX, ARCH_PPC64}, + {OS_LINUX, ARCH_PPC64LE}, + {OS_LINUX, ARCH_MIPS}, + {OS_LINUX, ARCH_MIPSLE}, + {OS_LINUX, ARCH_MIPS64}, + {OS_LINUX, ARCH_MIPS64LE}, + } +} + +func defaultNetBSD() []Platform { + return []Platform{ + {OS_NETBSD, ARCH_386}, + {OS_NETBSD, ARCH_AMD64}, + //{OS_NETBSD, ARCH_ARM}, + } +} + +func defaultOpenBSD() []Platform { + return []Platform{ + {OS_OPENBSD, ARCH_386}, + {OS_OPENBSD, ARCH_AMD64}, + //{OS_OPENBSD, ARCH_ARM}, + } +} + +func defaultPlan9() []Platform { + return []Platform{ + {OS_PLAN9, ARCH_386}, + {OS_PLAN9, ARCH_AMD64}, + } +} + +func defaultSolaris() []Platform { + return []Platform{ + {OS_SOLARIS, ARCH_AMD64}, + } +} + +func defaultWindows() []Platform { + return []Platform{ + {OS_WINDOWS, ARCH_386}, + {OS_WINDOWS, ARCH_AMD64}, + } +} -- cgit v1.2.3