2
0
mirror of synced 2025-02-24 15:28:28 +00:00

24 Commits

Author SHA1 Message Date
Hana Kim
274da16109 misc/androidstudio: release 0.2.13
$ docker run --rm -u root -v "$PWD":/home/gradle/project \
   -w /home/gradle/project gradle:latest gradle publishPlugins

gradle version 4.7

Change-Id: I5c86fed85c0e9896a413011fd04ce600743b8f54
Reviewed-on: https://go-review.googlesource.com/112616
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-05-10 18:31:09 +00:00
Elias Naur
5a56f36813 misc/androidstudio: drop the clean task to fix Android Studio gradle sync
Suggestion from

https://github.com/golang/go/issues/23307#issuecomment-368162189

I've manually verified in Android Studio that removing the clean task
does fix the issue reported in golang/go#25290.

Fixes golang/go#25290.
Fixes golang/go#23307.

Change-Id: Ic1a8c240fc8e4c4aaf59977fd559dd221ff605b1
Reviewed-on: https://go-review.googlesource.com/112455
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-05-09 17:20:40 +00:00
Hana (Hyang-Ah) Kim
60c2e06dc4 misc/androidstudio: publish 0.2.12
$ docker run --rm -u root -v "$PWD":/home/gradle/project \
   -w /home/gradle/project gradle:latest gradle publishPlugins

gradle version 4.7

Change-Id: Ib91807b88bf204122afa1296498492026894b153
Reviewed-on: https://go-review.googlesource.com/109435
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-04-26 14:24:15 +00:00
Junda Liu
ada9ee7b29 misc/androidstudio/src: drop the -i flag to avoid writing to a read-only $GOROOT
Gradle plugin failed on Mac due to -i flag trying to update /usr/local/go
Since go 1.10, The old advice to add the -i flag for speed,
as in go build -i or go test -i, is no longer necessary:
builds run just as fast without -i.

Fixes golang/go#25076

Change-Id: Ibddab3ff5961e06c8558f2a83af8a6964d622f40
Reviewed-on: https://go-review.googlesource.com/109144
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2018-04-25 17:22:43 +00:00
Elias Naur
37c5126484 misc/androidstudio/src/main/groovy/org/golang/mobile: update gobind path
Gobind now outputs Java sources to the java/ subdirectory. Update the
gradle plugin to match. Only projects using reverse bindings are
affected.

Change-Id: Id7f893d3c67a9ab63336c4e031c9196a0b6dad2c
Reviewed-on: https://go-review.googlesource.com/99775
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-03-16 06:59:25 +00:00
Hana Kim
78f32148b9 misc/androidstudio: update plugin version to 0.2.11
https://plugins.gradle.org/plugin/org.golang.mobile.bind/0.2.11

Built/published with

$ docker run --rm -u root -v "$PWD":/home/gradle/project \
     -w /home/gradle/project gradle:latest gradle publishPlugins

Gradle version 4.5.1

Change-Id: I431101a2b9000147430632ec24e76e8216c66935
Reviewed-on: https://go-review.googlesource.com/95455
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2018-02-20 15:45:06 +00:00
Vignesh Ramachandra
f52077efd0 misc/androidstudio: ensure gomobile bind completes before java compilation
When there is no prior gradle cache (i.e .gradle/ directory isn't created yet) in your Android project and a gradle build command is executed (e.g ./gradlew build), the *.so files generated by the gobind android plugin is not packaged into the apk.
Successive builds work fine though.

This issue doesn't happen when using Android plugin version 2.x, but does using version 3.x.

The gomobile bind task, libTask, is only finalizing the java compile task which allows it to run in parallel with javaCompile. That is probably too late, so instead, make libTask a dependency of the compile task to make sure the output of gomobile bind (in particular, the *so libraries) are included in the final build product.

Fixes golang/go#23766

Change-Id: I62727bfa0ffd54d8158c3a2aa3d7303867fcbabc
Reviewed-on: https://go-review.googlesource.com/94835
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2018-02-20 15:10:30 +00:00
Hana Kim
54bd6957e8 misc/androidstudio: update to 0.2.10
0.2.9 was broken - for unknown reasons, the plugin was built on
top of stale sources.

Updates golang/go#21594

Plugin 0.2.10 was built with rev 50b7067 and this change.
  % docker run --rm -u root -v "$PWD":/home/gradle/project \
    -w /home/gradle/project gradle:latest \
    gradle publishPlugins

Gradle version is 4.0.1.

Change-Id: I146dc67cbad3c9945a2acdf4ac7993283725090a
Reviewed-on: https://go-review.googlesource.com/86775
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2018-01-09 15:14:31 +00:00
Hana Kim
683b305bdb misc/androidstudio: version up gradle plugin to 0.2.9
Change-Id: Icedef49c575937fca885e050e569e513bb7880f7
Reviewed-on: https://go-review.googlesource.com/49258
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2017-07-17 18:12:14 +00:00
Ernest Chiang
901bda64d6 misc/androidstudio: check on javaCompile to avoid exception
In commit https://git.io/vQ1gV, the classpath was delayed evaluated to
the task executions. But at Library mode, there will be exception
because the javaCompile involved is not intialized. Add check to fix it.

Change-Id: I23ab2374a704de9fd7bf74ccfaed255045032b3d
Reviewed-on: https://go-review.googlesource.com/48050
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2017-07-11 14:22:22 +00:00
Elias Naur
d05d36a362 misc/androidstudio: fix the classpath for gobind and gomobile
Before this CL, the JavaCompile.classpath property was evaluated early,
which resulted in missing classpath entries for first-time runs of
gradle. Delay the evaluation, making sure gobind and gomobile receives
the complete classpath.

Change-Id: Iba9be0bbf9f563eb18b2549ac8267f8db3b7dec1
Reviewed-on: https://go-review.googlesource.com/35177
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2017-01-17 14:22:50 +00:00
Elias Naur
d8b1e1aab8 bind,misc: guard reverse generated import with mobile os tags
Running go get golang.org/x/mobile/... results in errors because the
go tool fails to find the reverse generated Java ("Java/...") and
Objective-C ("ObjC/...") packages. Work around the errors by adding
the android and ios tags, respectively, to files importing those
packages.

The gobind gradle plugin is updated to pass along GOOS=android to
ensure the gobind tool continues to build Android reverse packages.

Fixes golang/go#17750

Change-Id: Id66a3c6cdfe249c6ed494192eb12195d6509332f
Reviewed-on: https://go-review.googlesource.com/34956
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-01-17 14:22:42 +00:00
Elias Naur
82c03f1188 cmd/gomobile: document the GOMOBILEFLAGS, GOARCH, GOBIND plugin settings
Change-Id: I681ac02869e137f67880416743352951960f7d8a
Reviewed-on: https://go-review.googlesource.com/33950
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-01-12 21:57:09 +00:00
Takuya Ueda
98823363be misc/androidstudio: An example setting is wrong in README
REAME shows an example like this:

```
gobind {
  // Package to bind. Separate multiple packages with spaces.
  pkg "github.com/someone/somepackage"

  // GOPATH
  GOPATH "/home/gopher"

  // Optional list of architectures. Defaults to all supported architectures.
  GOARCH="arm amd64"

  // Absolute path to the gomobile binary. Optional.
  GOMOBILE "/mypath/bin/gomobile"

  // Absolute path to the gomobile binary. Optional.
  GOBIND "/mypath/bin/gobind"

  // Absolute path to the go binary. Optional.
  GO "/usr/local/go/bin/go"

  // Pass extra parameters to command line. Optional.
  GOMOBILEFLAGS "-javapkg my.java.package"
}
```

But this example is wrong because each settings need `=` between a key and value.

Fixes golang/go#17996

Change-Id: I0f7acca78aee1032a67c35308b4ce78f97b1aa43
Reviewed-on: https://go-review.googlesource.com/33372
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-11-21 14:18:27 +00:00
Elias Naur
276a798324 misc/androidstudio: fix gobind gradle plugin test
Change-Id: Icbec67cbc000e4770ccc82a95a1a9ce1e22bbc18
Reviewed-on: https://go-review.googlesource.com/32592
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-11-03 14:21:49 +00:00
Elias Naur
4db6347e33 misc/androidstudio: add support for the android gradle plugin
The gobind plugin exposes a set of Go packages as a AAR file ready to be
used by and Android project. Unfortunately, being a library project
limits the Go packages to access only the Java API from the standard
library and the Android SDK.

This CL tightens the integration with the Android plugin to support access
to project dependencies such as the Android Support Library, to the generated
R.* resource classes and finally to the Android databinding classes.

When the gradle project has loaded the Android plugin, the generation of
the Go library is split in two.
First, the gobind tool generates the Java classes for the bound Go
packages. In this step, Go packages can access the standard Java and Android
libraries as well as project dependencies. After this step, Android
databinding layout files can refer to Go classes.
In step two, the gomobile tool generates the JNI libraries
with the Go implementation of the generated Java classes. In this
step, Go can access the standard Java and Android libraries,
dependencies as well as R.* and generated databinding classes.

Change-Id: If853ecabdbd01eec5f89d064a6bc715cb20a4d83
Reviewed-on: https://go-review.googlesource.com/30094
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-10-05 13:08:54 +00:00
Hana Kim
df6b37ba82 misc/androidstudio: release gradle plugin 0.2.6
Also
- include a properties file for org.golang.mobile.bind.canary
which is used to canary before release.
- update example/bind/android gradle config.

Change-Id: I1dd0ff94a772b287a2f9be1a915ea72b1c3b0d52
Reviewed-on: https://go-review.googlesource.com/23678
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-02 18:18:59 +00:00
Kenneth Shaw
c435d0bad5 mobile: fix issues with GOMOBILEFLAGS in Gradle gobind plugin
A minor issue in the gobind gradle plugin script was preventing
GOMOBILEFLAGS from being correctly injected into the gomobile bind
command line. This change fixes that, as well as updates the
corresponding README.md with an example for passing the -javapkg flag to
gomobile.

The issue here is that after the split on GOMOBILEFLAGS, if
GOMOBILEFLAGS contained more than one parameter, ie "-javapkg my.pkg",
then the array gets aggregated into cmd, ie ["string1", ["-javapkg",
"my.pkg"], "string2"]. When join() is later called on cmd, this results
in a string looking like this: "string1 L[javajunk...] string2"

The cmd.addAll instead uses cmd's underlying Array Collection
interface to add all the elements from the gomobileFlags.split(" ")
call.

Change-Id: I45790035da7e09397ac2e610454ba7be1e619930
Reviewed-on: https://go-review.googlesource.com/22011
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-04-27 17:00:39 +00:00
Elias Naur
31eac4e11d mobile/misc/androidstudio: support multiple packages
Let the 'pkg' configuration contain multiple packages, separated by
spaces.

Change-Id: Iea4385c126aef7cf839b0fa542a3e6c4530f57fe
Reviewed-on: https://go-review.googlesource.com/20572
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-03-11 15:38:19 +00:00
Hyang-Ah Hana Kim
2e1e39e5a6 misc/androidstudio: release gobind gradle plugin 0.2.4
That supports GOARCH property.

Also this CL updates examples and upgrades the android gradle plugin
used in examples (from 1.2.3 to 1.5.0)

For golang/go#12819

Change-Id: Ibfed128eaf725775810aa539bd5c0e1ca88f1b85
Reviewed-on: https://go-review.googlesource.com/20331
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-03-08 02:06:34 +00:00
Elias Naur
493d0b451b modbile/misc/androidstudio: add GOARCH to the gradle plugin
Add GOARCH to the gobind gradle plugin to limit the architectures to
include in the fat .aar file. If GOARCH is empty or not specified,
every supported architecture is included.

GobindPlugin.groovy was indented with both tabs and (a varying number
of) spaces, so it is re-indented here with tabs. Sorry.

For golang/go#12819

Change-Id: I8b2cb72068df7750d20f474395944ca2968a2f1b
Reviewed-on: https://go-review.googlesource.com/20305
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-03-07 18:38:19 +00:00
Hyang-Ah (Hana) Kim
65551d85b6 misc/androidstudio: handle missing local.properties.
Fixes golang/go#12543

Change-Id: Ifb91e073ff2ebcba111e279949d5120a77b0dc2d
Reviewed-on: https://go-review.googlesource.com/14475
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-09-11 20:14:45 +00:00
Hyang-Ah (Hana) Kim
dc0c746bbb misc/androidstudio: change GobindPlugin parameters
Plugin version 0.2.2:

While debugging golang/go#11895 I noticed the PATH param is less
intuitive that I hoped for. This change makes the plugin requires
instead:

   pkg: the package to compile
   GOMOBILE: absolute path to gomobile
   GO: absolute path to go
   GOPATH: gopath.

GOMOBILE/GO params are optional if Android Studio is configured
to include right paths in its environment.

Additional changes included in this cl:
  - GOMOBILEFLAGS param for users to optionally specify gomobile
    options e.g. -v -x which will be useful for debugging.
  - Set src/target java version to 1.7. Previous versions of plugins
    were compiled with JDK8 by accident, which prevented use of
    the android studio recommended JDK7.

Change-Id: Ie7818eb20c5220b16ed0ebccfb91520fe03e6ccd
Reviewed-on: https://go-review.googlesource.com/12923
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-31 19:59:48 +00:00
Hyang-Ah (Hana) Kim
8c8ee830af misc/androidstudio: source code for gomobile bind gradle plugin.
Currently version 0.2.1

I messed up previous versions and plugins.gradle.org doesn't let me
remove the bad versions.

Change-Id: I9eef512633b461ff5a7fcbe11a3e104efb250d61
Reviewed-on: https://go-review.googlesource.com/12538
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-22 22:16:26 +00:00