Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
66441c9b
Commit
66441c9b
authored
Nov 25, 2016
by
Péter Szilágyi
Committed by
GitHub
Nov 25, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3345 from karalabe/cleanup-mobile-crossbuilds
Makefile, build: do proper mobile builds, not cross builds
parents
586f10ec
0f1cbfd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
16 deletions
+29
-16
Makefile
Makefile
+12
-13
ci.go
build/ci.go
+17
-3
No files found.
Makefile
View file @
66441c9b
...
@@ -2,12 +2,11 @@
...
@@ -2,12 +2,11 @@
# with Go source code. If you know what GOPATH is then you probably
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.
# don't need to bother with make.
.PHONY
:
geth geth-cross evm all test clean
.PHONY
:
geth
android ios
geth-cross evm all test clean
.PHONY
:
geth-linux geth-linux-386 geth-linux-amd64 geth-linux-mips64 geth-linux-mips64le
.PHONY
:
geth-linux geth-linux-386 geth-linux-amd64 geth-linux-mips64 geth-linux-mips64le
.PHONY
:
geth-linux-arm geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
.PHONY
:
geth-linux-arm geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
.PHONY
:
geth-darwin geth-darwin-386 geth-darwin-amd64
.PHONY
:
geth-darwin geth-darwin-386 geth-darwin-amd64
.PHONY
:
geth-windows geth-windows-386 geth-windows-amd64
.PHONY
:
geth-windows geth-windows-386 geth-windows-amd64
.PHONY
:
geth-android geth-ios
GOBIN
=
build/bin
GOBIN
=
build/bin
GO
?=
latest
GO
?=
latest
...
@@ -20,11 +19,21 @@ geth:
...
@@ -20,11 +19,21 @@ geth:
evm
:
evm
:
build/env.sh go run build/ci.go
install
./cmd/evm
build/env.sh go run build/ci.go
install
./cmd/evm
@
echo
"Done building."
@
echo
"Done building."
@
echo
"Run
\"
$(GOBIN)
/evm to start the evm."
@
echo
"Run
\"
$(GOBIN)
/evm
\"
to start the evm."
all
:
all
:
build/env.sh go run build/ci.go
install
build/env.sh go run build/ci.go
install
android
:
build/env.sh go run build/ci.go aar
--local
@
echo
"Done building."
@
echo
"Import
\"
$(GOBIN)
/geth.aar
\"
to use the library."
ios
:
build/env.sh go run build/ci.go xcode
--local
@
echo
"Done building."
@
echo
"Import
\"
$(GOBIN)
/Geth.framework
\"
to use the library."
test
:
all
test
:
all
build/env.sh go run build/ci.go
test
build/env.sh go run build/ci.go
test
...
@@ -112,13 +121,3 @@ geth-windows-amd64:
...
@@ -112,13 +121,3 @@ geth-windows-amd64:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--dest
=
$(GOBIN)
--targets
=
windows/amd64
-v
./cmd/geth
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--dest
=
$(GOBIN)
--targets
=
windows/amd64
-v
./cmd/geth
@
echo
"Windows amd64 cross compilation done:"
@
echo
"Windows amd64 cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-windows-
*
|
grep
amd64
@
ls
-ld
$(GOBIN)
/geth-windows-
*
|
grep
amd64
geth-android
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--dest
=
$(GOBIN)
--targets
=
android-21/aar
-v
./cmd/geth
@
echo
"Android cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-android-
*
geth-ios
:
build/env.sh go run build/ci.go xgo
--
--go
=
$(GO)
--dest
=
$(GOBIN)
--targets
=
ios-7.0/framework
-v
./cmd/geth
@
echo
"iOS framework cross compilation done:"
@
ls
-ld
$(GOBIN)
/geth-ios-
*
build/ci.go
View file @
66441c9b
...
@@ -29,8 +29,8 @@ Available commands are:
...
@@ -29,8 +29,8 @@ Available commands are:
importkeys -- imports signing keys from env
importkeys -- imports signing keys from env
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
debsrc [ -signer key-id ] [ -upload dest ] -- creates a debian source package
nsis -- creates a Windows NSIS installer
nsis -- creates a Windows NSIS installer
aar [ -
sign key-id ] [-deploy repo] [ -upload dest ]
-- creates an Android archive
aar [ -
local ] [ -sign key-id ] [-deploy repo] [ -upload dest ]
-- creates an Android archive
xcode [ -
sign key-id ] [-deploy repo] [ -upload dest ]
-- creates an iOS XCode framework
xcode [ -
local ] [ -sign key-id ] [-deploy repo] [ -upload dest ]
-- creates an iOS XCode framework
xgo [ options ] -- cross builds according to options
xgo [ options ] -- cross builds according to options
For all commands, -n prevents execution of external programs (dry run mode).
For all commands, -n prevents execution of external programs (dry run mode).
...
@@ -654,6 +654,7 @@ func doWindowsInstaller(cmdline []string) {
...
@@ -654,6 +654,7 @@ func doWindowsInstaller(cmdline []string) {
func
doAndroidArchive
(
cmdline
[]
string
)
{
func
doAndroidArchive
(
cmdline
[]
string
)
{
var
(
var
(
local
=
flag
.
Bool
(
"local"
,
false
,
`Flag whether we're only doing a local build (skip Maven artifacts)`
)
signer
=
flag
.
String
(
"signer"
,
""
,
`Environment variable holding the signing key (e.g. ANDROID_SIGNING_KEY)`
)
signer
=
flag
.
String
(
"signer"
,
""
,
`Environment variable holding the signing key (e.g. ANDROID_SIGNING_KEY)`
)
deploy
=
flag
.
String
(
"deploy"
,
""
,
`Destination to deploy the archive (usually "https://oss.sonatype.org")`
)
deploy
=
flag
.
String
(
"deploy"
,
""
,
`Destination to deploy the archive (usually "https://oss.sonatype.org")`
)
upload
=
flag
.
String
(
"upload"
,
""
,
`Destination to upload the archive (usually "gethstore/builds")`
)
upload
=
flag
.
String
(
"upload"
,
""
,
`Destination to upload the archive (usually "gethstore/builds")`
)
...
@@ -666,6 +667,11 @@ func doAndroidArchive(cmdline []string) {
...
@@ -666,6 +667,11 @@ func doAndroidArchive(cmdline []string) {
build
.
MustRun
(
gomobileTool
(
"init"
))
build
.
MustRun
(
gomobileTool
(
"init"
))
build
.
MustRun
(
gomobileTool
(
"bind"
,
"--target"
,
"android"
,
"--javapkg"
,
"org.ethereum"
,
"-v"
,
"github.com/ethereum/go-ethereum/mobile"
))
build
.
MustRun
(
gomobileTool
(
"bind"
,
"--target"
,
"android"
,
"--javapkg"
,
"org.ethereum"
,
"-v"
,
"github.com/ethereum/go-ethereum/mobile"
))
if
*
local
{
// If we're building locally, copy bundle to build dir and skip Maven
os
.
Rename
(
"geth.aar"
,
filepath
.
Join
(
GOBIN
,
"geth.aar"
))
return
}
meta
:=
newMavenMetadata
(
env
)
meta
:=
newMavenMetadata
(
env
)
build
.
Render
(
"build/mvn.pom"
,
meta
.
Package
+
".pom"
,
0755
,
meta
)
build
.
Render
(
"build/mvn.pom"
,
meta
.
Package
+
".pom"
,
0755
,
meta
)
...
@@ -768,6 +774,7 @@ func newMavenMetadata(env build.Environment) mavenMetadata {
...
@@ -768,6 +774,7 @@ func newMavenMetadata(env build.Environment) mavenMetadata {
func
doXCodeFramework
(
cmdline
[]
string
)
{
func
doXCodeFramework
(
cmdline
[]
string
)
{
var
(
var
(
local
=
flag
.
Bool
(
"local"
,
false
,
`Flag whether we're only doing a local build (skip Maven artifacts)`
)
signer
=
flag
.
String
(
"signer"
,
""
,
`Environment variable holding the signing key (e.g. IOS_SIGNING_KEY)`
)
signer
=
flag
.
String
(
"signer"
,
""
,
`Environment variable holding the signing key (e.g. IOS_SIGNING_KEY)`
)
deploy
=
flag
.
String
(
"deploy"
,
""
,
`Destination to deploy the archive (usually "trunk")`
)
deploy
=
flag
.
String
(
"deploy"
,
""
,
`Destination to deploy the archive (usually "trunk")`
)
upload
=
flag
.
String
(
"upload"
,
""
,
`Destination to upload the archives (usually "gethstore/builds")`
)
upload
=
flag
.
String
(
"upload"
,
""
,
`Destination to upload the archives (usually "gethstore/builds")`
)
...
@@ -777,12 +784,19 @@ func doXCodeFramework(cmdline []string) {
...
@@ -777,12 +784,19 @@ func doXCodeFramework(cmdline []string) {
// Build the iOS XCode framework
// Build the iOS XCode framework
build
.
MustRun
(
goTool
(
"get"
,
"golang.org/x/mobile/cmd/gomobile"
))
build
.
MustRun
(
goTool
(
"get"
,
"golang.org/x/mobile/cmd/gomobile"
))
build
.
MustRun
(
gomobileTool
(
"init"
))
bind
:=
gomobileTool
(
"bind"
,
"--target"
,
"ios"
,
"--tags"
,
"ios"
,
"--prefix"
,
"GE"
,
"-v"
,
"github.com/ethereum/go-ethereum/mobile"
)
if
*
local
{
// If we're building locally, use the build folder and stop afterwards
bind
.
Dir
,
_
=
filepath
.
Abs
(
GOBIN
)
build
.
MustRun
(
bind
)
return
}
archive
:=
"geth-"
+
archiveBasename
(
"ios"
,
env
)
archive
:=
"geth-"
+
archiveBasename
(
"ios"
,
env
)
if
err
:=
os
.
Mkdir
(
archive
,
os
.
ModePerm
);
err
!=
nil
{
if
err
:=
os
.
Mkdir
(
archive
,
os
.
ModePerm
);
err
!=
nil
{
log
.
Fatal
(
err
)
log
.
Fatal
(
err
)
}
}
bind
:=
gomobileTool
(
"bind"
,
"--target"
,
"ios"
,
"--tags"
,
"ios"
,
"--prefix"
,
"GE"
,
"-v"
,
"github.com/ethereum/go-ethereum/mobile"
)
bind
.
Dir
,
_
=
filepath
.
Abs
(
archive
)
bind
.
Dir
,
_
=
filepath
.
Abs
(
archive
)
build
.
MustRun
(
bind
)
build
.
MustRun
(
bind
)
build
.
MustRunCommand
(
"tar"
,
"-zcvf"
,
archive
+
".tar.gz"
,
archive
)
build
.
MustRunCommand
(
"tar"
,
"-zcvf"
,
archive
+
".tar.gz"
,
archive
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment