Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Spec Updates
Browse files Browse the repository at this point in the history
This change updates the library to match upcoming spec changes.  It adds the
Platform to Detect, updates the Detect logger to use stdout, updates Detect's
build plan output to write to <platform>/plan, and updates Build to allow
claims on build plan dependencies via <platform>/plan.

[buildpacks/spec#27]

Signed-off-by: Ben Hale <bhale@pivotal.io>
  • Loading branch information
nebhale committed Nov 28, 2018
1 parent 1635664 commit dcfdf32
Show file tree
Hide file tree
Showing 47 changed files with 3,738 additions and 3,434 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# `libjavabuildpack`
`libjavabuildpack` is a Go library with useful functionality for building Java Buildpack-related buildpacks.
# `libcfbuildpack`
`libcfbuildpack` is a Go library with useful functionality for building Cloud Foundry-related buildpacks.

## License
This library is released under version 2.0 of the [Apache License][a].
Expand Down
96 changes: 48 additions & 48 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,51 @@

package libjavabuildpack

import (
"fmt"

"github.com/buildpack/libbuildpack"
)

// Build is an extension to libbuildpack.Build that allows additional functionality to be added.
type Build struct {
libbuildpack.Build

// Buildpack represents the metadata associated with a buildpack.
Buildpack Buildpack

// Cache represents the cache layers contributed by a buildpack.
Cache Cache

// Launch represents the launch layers contributed by the buildpack.
Launch Launch

// Logger is used to write debug and info to the console.
Logger Logger
}

// String makes Build satisfy the Stringer interface.
func (b Build) String() string {
return fmt.Sprintf("Build{ Build: %s, Buildpack: %s, Cache: %s, Logger: %s }",
b.Build, b.Buildpack, b.Cache, b.Logger)
}

// DefaultBuild creates a new instance of Build using default values.
func DefaultBuild() (Build, error) {
b, err := libbuildpack.DefaultBuild()
if err != nil {
return Build{}, err
}

logger := Logger{b.Logger}
buildpack := NewBuildpack(b.Buildpack)
cache := Cache{b.Cache, buildpack.CacheRoot, logger}

return Build{
b,
buildpack,
cache,
Launch{b.Launch, cache, logger},
logger,
}, nil
}
// import (
// "fmt"
//
// "github.com/buildpack/libbuildpack"
// )
//
// // Build is an extension to libbuildpack.Build that allows additional functionality to be added.
// type Build struct {
// libbuildpack.Build
//
// // Buildpack represents the metadata associated with a buildpack.
// Buildpack Buildpack
//
// // Cache represents the cache layers contributed by a buildpack.
// Cache Cache
//
// // Launch represents the launch layers contributed by the buildpack.
// Launch Launch
//
// // Logger is used to write debug and info to the console.
// Logger Logger
// }
//
// // String makes Build satisfy the Stringer interface.
// func (b Build) String() string {
// return fmt.Sprintf("Build{ Build: %s, Buildpack: %s, Cache: %s, Logger: %s }",
// b.Build, b.Buildpack, b.Cache, b.Logger)
// }
//
// // DefaultBuild creates a new instance of Build using default values.
// func DefaultBuild() (Build, error) {
// b, err := libbuildpack.DefaultBuild()
// if err != nil {
// return Build{}, err
// }
//
// logger := Logger{b.Logger}
// buildpack := NewBuildpack(b.Buildpack)
// cache := Cache{b.Cache, buildpack.CacheRoot, logger}
//
// return Build{
// b,
// buildpack,
// cache,
// Launch{b.Launch, cache, logger},
// logger,
// }, nil
// }
Loading

0 comments on commit dcfdf32

Please sign in to comment.