Skip to content

Commit

Permalink
Merge pull request #230 from paketo-buildpacks/re-org
Browse files Browse the repository at this point in the history
Custom build logic removed, now builds with libjvm
  • Loading branch information
Daniel Mikusa authored Jul 7, 2022
2 parents 07af463 + 0290b53 commit 2ced41d
Show file tree
Hide file tree
Showing 22 changed files with 34 additions and 1,429 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ The buildpack will do the following if a JRE is requested:
| `$BPL_DEBUG_SUSPEND` | Configure whether to suspend execution until a debugger has attached. Defaults to `false`. |
| `$BPL_JFR_ENABLED` | Configure whether Java Flight Recording (JFR) is enabled. If no arguments are specified via `BPL_JFR_ARGS`, the default config args `dumponexit=true,filename=/tmp/recording.jfr` are added. |
| `$BPL_JFR_ARGS` | Configure custom arguments to Java Flight Recording, via a comma-separated list, e.g. `duration=10s,maxage=1m`. If any values are specified, no default args are supplied. |
| `$BP_JVM_JLINK_ENABLED` | Configures whether to run the JDK's jlink tool at build time to generate a custom JRE. Defaults to `false`. If no custom args are specified, the default args are `--no-man-pages --no-header-files --strip-debug --compress=1`.
| `$BP_JVM_JLINK_ARGS` | Configure custom arguments to supply to the jlink tool. If any custom args are specified, no default args are supplied.
| `$BPL_HEAP_DUMP_PATH` | Configure the location for writing heap dumps in the event of an OutOfMemoryError exception. Defaults to ``, which disables writing heap dumps. The path set must be writable by the JVM process. |
| `$JAVA_TOOL_OPTIONS` | Configure the JVM launch flags |

Expand Down
12 changes: 12 additions & 0 deletions buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ api = "0.7"
launch = true
name = "BPL_JFR_ARGS"

[[metadata.configurations]]
default = "false"
description = "enables running jlink tool to generate custom JRE"
build = true
name = "BP_JVM_JLINK_ENABLED"

[[metadata.configurations]]
default = "--no-man-pages --no-header-files --strip-debug --compress=1"
description = "configure custom link arguments (--output must be omitted)"
build = true
name = "BP_JVM_JLINK_ARGS"

[[metadata.configurations]]
build = true
default = "11"
Expand Down
17 changes: 10 additions & 7 deletions cmd/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
package main

import (
"os"

"github.com/paketo-buildpacks/libjvm"
"github.com/paketo-buildpacks/libjvm/helper"

"github.com/paketo-buildpacks/libpak"
"github.com/paketo-buildpacks/libpak/bard"

"github.com/paketo-buildpacks/graalvm/v7/graalvm"
"os"
)

func main() {
Expand All @@ -33,8 +30,14 @@ func main() {
// not used directly, but this forces the helper module to be included in the module
// we need the helper module because of the way that `scripts/build/sh` builds the helper cmd
_ = helper.ActiveProcessorCount{Logger: logger}

libpak.Main(
graalvm.Detect{},
graalvm.Build{Logger: logger},
libjvm.Detect{},
libjvm.NewBuild(logger, libjvm.WithNativeImage(
libjvm.NativeImage{
BundledWithJDK: false,
CustomCommand: "/bin/gu",
CustomArgs: []string{"install", "--local-file"},
})),
)
}
20 changes: 6 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,32 @@ module github.com/paketo-buildpacks/graalvm/v7
go 1.17

require (
github.com/buildpacks/libcnb v1.26.0
github.com/heroku/color v0.0.6
github.com/onsi/gomega v1.19.0
github.com/paketo-buildpacks/libjvm v1.37.0
github.com/paketo-buildpacks/libjvm v1.38.0
github.com/paketo-buildpacks/libpak v1.60.1
github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible
github.com/sclevine/spec v1.4.0
github.com/stretchr/testify v1.8.0
)

require (
github.com/BurntSushi/toml v1.1.0 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/buildpacks/libcnb v1.26.0 // indirect
github.com/creack/pty v1.1.18 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/h2non/filetype v1.1.3 // indirect
github.com/heroku/color v0.0.6 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/miekg/dns v1.1.49 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/onsi/gomega v1.19.0 // indirect
github.com/pavel-v-chernykh/keystore-go/v4 v4.3.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.4.0 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

)
11 changes: 4 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,23 @@ github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/miekg/dns v1.1.49 h1:qe0mQU3Z/XpFeE+AEBo2rqaS1IPBJ3anmqZ4XiZJVG8=
github.com/miekg/dns v1.1.49/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA=
github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc=
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
github.com/paketo-buildpacks/libjvm v1.37.0 h1:wzuSf5p/fjO2tn8KvEE6RT+Z7KhFp5SZUUwvKX7BjQE=
github.com/paketo-buildpacks/libjvm v1.37.0/go.mod h1:byHYhEv4l3Shn+/vOZ20jItJWv9iDWfdLY6fgLPz8e8=
github.com/paketo-buildpacks/libjvm v1.38.0 h1:tDIVUSDdibrmY9es4+8C4RbQ8SZ14jkbjiLEV2yZH/U=
github.com/paketo-buildpacks/libjvm v1.38.0/go.mod h1:R5B0MdLESY/CSrMC9Xpz1TtLnEvnrUZ4KAdW0OWUqow=
github.com/paketo-buildpacks/libpak v1.60.1 h1:VSwGTxXIODXAKvv43QI6n+FgVVo0tRDP5g090BKLtMM=
github.com/paketo-buildpacks/libpak v1.60.1/go.mod h1:vryAkvs1BKsy+9++Lh1y9kquWlTFBGzPTUuvs2Ta90I=
github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible h1:Jd6xfriVlJ6hWPvYOE0Ni0QWcNTLRehfGPFxr3eSL80=
Expand Down Expand Up @@ -162,7 +160,6 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
Expand Down
200 changes: 0 additions & 200 deletions graalvm/build.go

This file was deleted.

Loading

0 comments on commit 2ced41d

Please sign in to comment.