Giter Site home page Giter Site logo

Comments (15)

bootstraponline avatar bootstraponline commented on April 26, 2024

πŸ‘

from buck.

davido avatar davido commented on April 26, 2024

Actually it is already solved as reusable building blocks: bucklets [1]. Just pull and include it in your repository as git submodule. Working example provided [2].

[1] https://gerrit-review.googlesource.com/#/admin/projects/bucklets
[2] https://gerrit-review.googlesource.com/#/admin/projects/gitiles

from buck.

bootstraponline avatar bootstraponline commented on April 26, 2024

Awesome. Thanks!

from buck.

bootstraponline avatar bootstraponline commented on April 26, 2024

@davido Do you know if there's a way to pull the jar with dependencies? It seems like I have to hard code the dependencies as they're not read in from the pom.

from buck.

davido avatar davido commented on April 26, 2024

@bootstraponline transitive dependencies currently not supported in buckles.

from buck.

tbroyer avatar tbroyer commented on April 26, 2024

How about an external tool that would download the dependencies (transitively) based on some manifest file and generate a BUCK file filled with prebuilt_jar?
That tool could be implemented with either Γ†ther or Ivy (or Gradle!), and could possibly share the download cache with, say, Maven (~/.m2/repository/) or Gradle (~/.gradle/caches).

Having it built-in though, Buck could possibly cache the downloaded artifacts in a distributed cache (I have no idea whether and how it could also cache the transitive dependencies without having them specifically hand-written in the BUCK files)

See http://blog.ltgt.net/in-quest-of-the-ultimate-build-tool/

from buck.

davido avatar davido commented on April 26, 2024

Well, i am not a big fun of transitive dependencies. Currently we hard code them in maven_jar():

maven_jar(
  name = 'gwt-dev',
  id = 'com.google.gwt:gwt-dev:' + VERSION,
  sha1 = 'af3d9ad2fb8be30dc87fdcd6d9a373b2ab675802',
  license = 'Apache2.0',
  deps = [
    ':javax-validation',
    ':javax-validation_src',
  ],
  attach_source = False,
  exclude = ['org/eclipse/jetty/*'],
)

maven_jar(
  name = 'javax-validation',
  id = 'javax.validation:validation-api:1.0.0.GA',
  bin_sha1 = 'b6bd7f9d78f6fdaa3c37dae18a4bd298915f328e',
  src_sha1 = '7a561191db2203550fbfa40d534d4997624cd369',
  license = 'Apache2.0',
  visibility = [],
)

Current implementation of maven_jar() [1] is using download_file.py [2] where we can do something funny, like:

  • strip parts from the Maven artifact. This is needed, because recent GWT is shipping old version of Jetty container (8.x) that collides with the version shipped with Gerrit master (9.1):
[...]
exclude = ['org/eclipse/jetty/*'],
[...]
  • strip JAR signing stuff, note unsign = True:
maven_jar(
  name = 'jgit',
  id = 'org.eclipse.jgit:org.eclipse.jgit:' + VERS,
  bin_sha1 = '421e66466c7946b8f5e5a841297fe44d2071ab88',
  src_sha1 = '281dd1817e53814ee055e346d572f687688a8463',
  license = 'jgit',
  repository = REPO,
  unsign = True,
  deps = [':ewah'],
)

And as you pointed out, we use already directory cache in Buck, but could easily set up distributed cache instead.

[1] https://gerrit.googlesource.com/bucklets/+/master/maven_jar.bucklet
[2] https://gerrit.googlesource.com/bucklets/+/master/tools/download_file.py

from buck.

maxme avatar maxme commented on April 26, 2024

πŸ‘ for having reusable bucklets library, including maven_jar for instance.

from buck.

davido avatar davido commented on April 26, 2024

Well, that's not me. That was extracted from Gerrit Code Review project. So if you would like to say "Thank you guys for having reusable bucklets library, including maven_jar", the right place to do that is this forum: [1] ;-)

[1] https://groups.google.com/forum/#!forum/repo-discuss

from buck.

bootstraponline avatar bootstraponline commented on April 26, 2024

I think this issue is about getting maven into the core buck project.
On Aug 19, 2014 8:35 AM, "David Ostrovsky" [email protected] wrote:

Well, that's not me. That was extracted from Gerrit Code Review project.
So if you would like to say "Thank you guys for having reusable bucklets
library, including maven_jar", the right place to do that is this forum:
[1] ;-)

[1] https://groups.google.com/forum/#!forum/repo-discuss

β€”
Reply to this email directly or view it on GitHub
#64 (comment).

from buck.

davido avatar davido commented on April 26, 2024

Not necessarily. It depends how and if Bucklets are integrated in Buck core. Let's assume, that Bucklets are natively supported by Buck as discussed in this thread: [1].

So that you can say in .bucklets file in your project:

[bucklet]
  gerrit:maven_jar:1.0

[repository]
  gerrit = https://gerrit.googlesource.com/bucklets

And you are done: you can now include maven_jar() rule in your BUCK files and it just works.

[1] https://groups.google.com/d/topic/buck-build/VIgYyJKn088/discussion

from buck.

bootstraponline avatar bootstraponline commented on April 26, 2024

Yes, that's what I meant. Native support for bucklets. It's not clear if
this will ever happen though.
On Aug 19, 2014 9:18 AM, "David Ostrovsky" [email protected] wrote:

Not necessarily. It depends how and if Bucklets are integrated in Buck
core. Let's assume, that Bucklets are natively supported by Buck as
discussed in this thread: [1].

So that you can say in .bucklets file in your project:

[bucklet]
gerrit:maven_jar:1.0

[repository]
gerrit = https://gerrit.googlesource.com/bucklets

And you are done: you can now include maven_jar() rule in your BUCK files
and it just works.

[1] https://groups.google.com/d/topic/buck-build/VIgYyJKn088/discussion

β€”
Reply to this email directly or view it on GitHub
#64 (comment).

from buck.

davido avatar davido commented on April 26, 2024

We are almost there. 9735ae8 added remote_file() rule to Buck:

#maven_jar(
#  name = 'httpmime',
#  id = 'org.apache.httpcomponents:httpmime:4.3.4',
#  bin_sha1 = '54ffde537682aea984c22fbcf0106f21397c5f9b',
#  src_sha1 = '0651e21152b0963661068f948d84ed08c18094f8',
#  license = 'Apache2.0',
#)

prebuilt_jar(
  name = 'httpmime',
  binary_jar = ':httpmime-jar',
  source_jar = ':httpmime-src',
)

remote_file(
  name = 'httpmime-jar',
  sha1 = '54ffde537682aea984c22fbcf0106f21397c5f9b',
  url = 'mvn:org.apache.httpcomponents:httpmime:jar:4.3.4',
  out = 'httpmime.jar',
)

remote_file(
  name = 'httpmime-src',
  sha1 = '0651e21152b0963661068f948d84ed08c18094f8',
  url = 'mvn:org.apache.httpcomponents:httpmime:src:4.3.4',
  out = 'httpmime-src.jar',
)

For some reasons it doesn't work: #192

from buck.

sdwilsh avatar sdwilsh commented on April 26, 2024

3afdcbd added a buck fetch command. Are we good here now?

from buck.

davido avatar davido commented on April 26, 2024

Indeed, 3afdcbd fixed it.

from buck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.