Commit Graph

42 Commits

Author SHA1 Message Date
Matthias Sohn 13f9aae49a Fix tools/version.sh
The script missed to update all but the first version in
org.eclipse.jgit.coverage/pom.xml

Change-Id: If8021accf07d7b57b477992cc0f1ba8ddc7db9a6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-17 03:10:09 +01:00
Matthias Sohn 5218d2f5da Add new ssh bundles to Maven central scripts
Change-Id: I5c41426f59a60af3da808f89be4e498c7ba2196e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-09 00:12:59 +01:00
David Pursehouse 1385f4b3da Bazel: Increase severity of ClassCanBeStatic to ERROR
Change-Id: I8250fd15cfff6bbba54a238be31b3cf772edab3f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-11-08 11:09:54 +09:00
David Pursehouse 3ec3ca0f09 Bazel: Format tools/BUILD with buildifier
Change-Id: I292613a0e40d2022bc68c6acbd45d37a54c1e613
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-11-06 13:50:04 +09:00
David Ostrovsky 9625db20a5 Upgrade to Bazel 0.19.0
Also replace native git_repository rule with Starlark rule. This is
needed because in recent Bazel versions native git_repository rule
is deprecated.

Change-Id: I2c19fd31693a930d7d35fdbb93bfa4abf21fa2aa
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2018-11-01 23:49:10 +01:00
David Pursehouse d54fc955be Bazel: Increase severity of DefaultCharset to ERROR
All existing instances of this issue have been fixed in preceding
commits. Increase its severity to ERROR so that it is easier to
detect reoccurences.

Change-Id: I50f95152857baac5ca44c15493f23b6f9cfac1bf
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-30 17:02:11 +09:00
David Pursehouse f5d7f93b52 Bazel: Increase severity of MissingFail to ERROR
All instances of this potential bug have been cleaned up in
preceding commits. Increase the severity to ERROR so that it
is easier to detect reoccurences.

Change-Id: I25beebcea1f01f468e0f2b1d24a83511029c077c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-30 14:34:14 +09:00
David Pursehouse 1f14c16ae4 Bazel: Increase severity of ExpectedExceptionChecker to ERROR
Incorrect usage of ExpectedException has been cleaned up in the
preceding commits. Increase the severity from WARN to ERROR so
that it is easier to catch any reoccurences.

Change-Id: I57decf620b37e85413bda53723f839c02b488f2c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-26 08:31:13 +09:00
David Ostrovsky 7d89f0a053 Bazel: Provide toolchain with activated error prone warnings
On recent bazel versions it's trivial to apply package specific checks.
Provide custom java toolchain with all error prone warnings activated.

The list of all error prone warnings was borrowed from here: [1].

Test Plan:

  $ bazel build --java_toolchain //tools:error_prone_warnings_toolchain \
    //...

[1] https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl

Change-Id: I207a368555bfb7ddab8d782d46d563ce779a6211
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-09-22 19:12:59 +09:00
David Pursehouse b270e4b740 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I414ade902dc38b696c566dd604000e3d289f3973
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-08-31 09:25:43 +09:00
David Pursehouse 487571e604 Bazel: Format all build files with buildifier 0.15.0
Change-Id: I8343b723da6e40d5ae7fc45c84f64c31276bd5dc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-08-30 15:27:20 +09:00
Matthias Sohn 4cfaef4c20 Fix version.sh to update version of imported jgit features
Change-Id: I9f29e84b4d357ac8910b8dc534ea91dc9be96079
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-04-05 14:48:00 +02:00
David Ostrovsky e92a0c3adc Implement initial framework of Bazel build
The initial implementation only builds the packages consumed by
Gerrit Code Review.

Test build and execution is not implemented.

We prefer to consume maven_jar custom rule from bazlets repository,
for the same reasons as in the Gerrit project:

* Caching artifacts across different clones and projects
* Exposing source classifiers and neverlink artifact

TEST PLAN:

  $ bazel build :all
  $ unzip -t bazel-genfiles/all.zip
  Archive: bazel-genfiles/all.zip
    testing: libjgit-archive.jar      OK
    testing: libjgit-servlet.jar      OK
    testing: libjgit.jar              OK
    testing: libjunit.jar             OK
  No errors detected in compressed data of bazel-genfiles/all.zip.

Change-Id: Ia837ce95d9829fe2515f37b7a04a71a4598672a0
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2017-01-18 19:13:16 -04:00
Matthias Sohn ab79ce91c1 Change JGit minimum execution environment to JavaSE-1.8
Bug: 500059
Change-Id: I47f3f6749a67da52029f84e002d9b155ed56d2b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-09-20 11:32:36 +02:00
Matthias Sohn e3b45f79b6 Run Maven build in release.sh concurrently to speedup release
Change-Id: Iad8696825bb81becab945cd9ed2c33bea3778e17
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-05-04 17:34:35 +02:00
Matthias Sohn 24b6c080d7 Add lfs libraries to scripts for upload to Maven central
Change-Id: I13d78fd57421cca32a965af37cc9571e77448e31
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-04-08 17:24:44 +02:00
Matthias Sohn 5da5eb4b69 Remove java7 bundle from Maven central scripts
The bundle org.eclipse.jgit.java7 was deleted in 4.0

Change-Id: I57dbc0b18eaf164c8f53cc2b776ecb80481a993d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-22 01:50:36 +01:00
David Pursehouse aca07fac46 Merge branch 'stable-4.2'
* stable-4.2:
  CheckoutCommandTest: Create Git instances in try-with-resource
  BranchCommandTest: Create Git instances in try-with-resource
  CheckoutTest: Create Git instances in try-with-resource
  BranchTest: Create Git instances in try-with-resource
  URIishTest: Use @Test annotation's `expected` argument
  Suppress "The allocated object is never used" warning in tests
  Add $NON-NLS to suppress "Non-externalized string literal" warnings
  Don't use deprecated constructors of CmdLineException
  Prepare 4.2.0-SNAPSHOT builds
  Remove org.eclipse.jgit.updatesite project from tools/version.sh
  RevParse: Remove superfluous semicolon
  RefUpdateTest: Use try-with-resource for auto-closable types
  RefUpdateTest: Add null check to prevent potential NPE
  CommitCommand: Remove redundant null check
  JGit v4.2.0.201512141825-rc1

Change-Id: I2179859289b2f2e3d0b7c6d02ef7e7890c467f7b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-20 09:45:48 +09:00
Matthias Sohn 8d3584f4d3 Remove org.eclipse.jgit.updatesite project from tools/version.sh
We don't need to update versions for this project which was removed
a long time ago.

Change-Id: Ie2d030134942add152847581797db3a213ec4c9e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-19 13:08:23 +01:00
Shawn Pearce 776c3003aa buck: set Bundle-Version for :jgit_bin
Run git describe during the build to determine the lineage of this
working directory and stamp this information into the binary.

Change-Id: I0ad24125c31e4280ccf900bac4065924087b05aa
2016-01-03 09:30:16 -08:00
David Ostrovsky 13502fef8f Implement Buck driven build
Today there are plenty of modern build tool systems available in the
wild (in no particular order):

* http://bazel.io
* https://pantsbuild.github.io
* http://shakebuild.com
* https://ninja-build.org
* https://buckbuild.com

The attributes, that all these build tools have in common, are:

* reliable
* correct
* very fast
* reproducible

It must not always be the other build tool, this project is currently
using. Or, quoting Gerrit Code Review maintainer here:

  "Friends, don't let friends use <the other build tool system>!"

This change is non-complete implementation of JGit build in Buck,
needed by Gerrit Code Review to replace its dependency with standlone
JGit cell. This is very useful when a developer is working on both
projects and is trying to integrate changes made in JGit in Gerrit.

The supported workflow is:

  $ cd jgit
  $ emacs <hack>
  $ cd ../gerrit
  $ buck build --config repositories.jgit=../jgit gerrit

With --config repositories.jgit=../jgit jgit cell is routed through
JGit development tree.

To build jgit, issue:

  $ buck build //:jgit
  [-] PROCESSING BUCK FILES...FINISHED 0,0s

Yes, you can't measure no-op build time, given that Buck daemon is
used.

Change-Id: I301a71b19fba35a5093d8cc64d4ba970c2877a44
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2015-12-31 10:08:55 -08:00
Matthias Sohn 6c1f739388 Move console classes to pgm bundle
Since we updated minimum Java version to Java 7 the console bundle
doesn't need to be a separate bundle anymore. Move the contained classes
to the pgm bundle which is using these classes.

Change-Id: If8e6f2d7405fdfe6f4b178673b4ccf99c67d4b64
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-02-10 09:14:48 +01:00
Matthias Sohn c26bc63ef1 Set minimum required Java version to Java 7
Bug: 458475
Change-Id: Iea8f2236d4e6a94a8d14bb8cc685006ea3fd1bb7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-02-09 14:11:50 +01:00
Matthias Sohn be25ecb393 Enable passing version number to maven central scripts
Also check if the passed version matches the version pattern
<major>.<minor>.<micro>.<qualifier>-<classifier>

Change-Id: Ib7edf51fb5e89232909611de5b4811a62b4f3953
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-06-06 15:41:22 +02:00
Matthias Sohn 94953ac9ca Add script to create JGit release
Change-Id: I620a209406dd021f3e8e1dafcfb381631dfd25d2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-21 20:10:19 +02:00
Matthias Sohn 792d27ece1 Fix version.sh to update Eclipse-SourceBundle version
The version attribute of Eclipse-SourceBundle must match
the bundle version.

Change-Id: Ic629ccae1d89c9070e4ec80420a0e2ed7d403922
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-04-18 01:40:47 +02:00
Matthias Sohn f59b680c4c Update scripts to deploy jgit on Maven central
Change-Id: I760ad82f2455cfc2cdc76c9331a03b09aebb2349
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-03-05 00:43:21 +01:00
Matthias Sohn 8de3512890 Scripts to publish jgit artifacts on Maven central
- you need an account on oss.sonatype.org and permissions for group id
  org.eclipse.jgit, see [1]
- install ruby [2] if necessary
- run download.rb to download the Maven artifacts from repo.eclipse.org
- then run deploy.rb to stage the artifacts on oss.sonatype.org
- follow [3] to close the staging repository which triggers some sanity
checks on Nexus
- ask community to test artifacts from staging repository
- if tests are ok release the staging repository as described in [4]

[1] https://issues.sonatype.org/browse/OSSRH-2758
[2] https://www.ruby-lang.org/en/downloads/
[3]
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-7b.StageExistingArtifacts
[4]
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8a.ReleaseIt

Change-Id: I830f2392b9234e585b01dbb4a5a369edd88796a2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-10-17 23:15:46 +02:00
Shawn Pearce fe248d24db Remove fix-headers and rewrite-history
These scripts were created to bootstrap the initial contribution for
Eclipse using information from the pre-Eclipse history. We are well
past the point where the project will rewrite history in order to
correct copyright statements, so these tools no longer make sense
to keep in the tip of the tree.

Change-Id: If68419ead0766035d17a21a53a3e5e761eaa70c4
2013-06-19 15:29:15 -07:00
Matthias Sohn 79a2e28a93 Fix version.sh to not overwrite ${project.version}
Change-Id: If5ae792581170bcba2dc1860012cbe389d8e9f24
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2013-06-04 22:28:01 +02:00
Matthias Sohn c1f352c100 Fix version.sh
Change-Id: Icdf5d9ea3ca62839cbf7de13dfee9682056b7cef
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-12-10 01:03:33 +01:00
Shawn O. Pearce 8d88a842da tools/release: Handle v1.0.0.201106090707-r-NN-gdeadbeef
The 1.0.0 release tags have a new suffix.
Account for this.

Change-Id: Ic6f260b6a5ba353af3b312b722f576155208eaa0
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2011-06-24 14:09:20 -07:00
Matthias Sohn e2a35242b0 Fix version.sh
Change-Id: Ia010c9cecefbfb90ae54786adc7c8d838525d2f3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2011-02-11 23:21:49 +01:00
Shawn O. Pearce 629fd0d594 Clean up LICENSE file
We used our LICENSE file to describe both the license of the package,
and also the header template that should appear at the start of
all Java files we create.  This creates a confusing situation for
readers who just want to consume the package, because our file
header template starts off in the middle of a sentence.

Move our template header to a separate file, and reformat the text
of the license to be something more readable by a person reviewing
the project's terms of use.

Change-Id: If318e64c06683ea14e0240914c2d057c9199ce98
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-07-02 14:52:49 -07:00
Shawn O. Pearce 200f3caefc tools/version.sh: Use backup files on Win32
Windows doesn't permit us to edit a file in-place with Perl.
So create backup files when we perform the edit, and remove them
when we are done.  This is a tad slower on POSIX systems, but is
much more portable.

Change-Id: I429c7d698924cb32e709363f5da82f7232bbdab2
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-14 08:19:56 -07:00
Shawn O. Pearce 7804045c66 Bump all features during release
Change-Id: I3103c54a2a525f5f190cf35b63394dad6d02cc5e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-02 14:41:06 -07:00
Shawn O. Pearce 764f1635d4 tools/version.sh: Update OSGi manifest files
Tag the version number and API range in the OSGi manifest files
whenever we bump the pom.xml files.

Change-Id: I7c38b51f7139c02bef6b0e67d3f9199cbcdc8a39
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-03-18 19:20:32 -07:00
Matthias Sohn 578225870a Script to fix license headers and copyrights in Java sources
The script merges explicit copyright statements in all Java
sources with author information from git history, updates the
copyright headers accordingly, and updates the license headers
to EDL.  For recognized copyright formats see the test data in
tools/fix-headers.tst.

To fix headers only in the current working directory:

  ./tools/fix-headers.pl

To fix the headers for all revisions (don't do this if you don't
understand the implications of rewriting history) run:

  ./tools/rewrite-history.sh

Authors are mapped to employer copyright statements through a
hardcoded table in the top of the script.  This is a crude but
simple way to list date ranges under which certain changes need
to be attributed to copyright holders other than the author.

Change-Id: I654d758658cded02d91324c385f336bcc57fd85f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-03-08 09:27:03 -08:00
Shawn O. Pearce fc5fc70e2e Switch build to Apache Felix maven-bundle-plugin
Tycho isn't production ready for projects like JGit to be using as
their primary build driver.  Some problems we ran into with Tycho
0.6.0 that are preventing us from using it are:

 * Tycho can't run offline

   The P2 artifact resolver cannot perform its work offline.  If the
   build system has no network connection, it cannot compile a
   project through Tycho.  This is insane for a distributed version
   control system where developers are used to being offline during
   development and local testing.

 * Magic state in ~/.m2/repository/.meta/p2-metadata.properties

   Earlier iterations of this patch tried to use a hybrid build,
   where Tycho was only used for the Eclipse specific feature and P2
   update site, and maven-bundle-plugin was used for the other code.
   This build seemed to work, but only due to magic Tycho specific
   state held in my local home directory.  This means builds are not
   consistently repeatable across systems, and lead me to believe
   I had a valid build, when in fact I did not.

 * Manifest-first build produces incomplete POMs

   The POM created by the manifest-first build format does not
   contain the dependency chain, leading a downstream consumer to
   not import the runtime dependencies necessary to execute the
   bundle it has imported.  In JGit's case, this means JSch isn't
   included in our dependency chain.

 * Manifest-first build produces POMs unreadable by Maven 2.x

   JGit has existing application consumers who are relying on
   Maven 2.x builds.  Forcing them to step up to an alpha release
   of Maven 3 is simply unacceptable.

 * OSGi bundle export data management is tedious

   Editing each of our pom.xml files to mark a new release is
   difficult enough as it is.  Editing every MANIFEST.MF file to
   list our exported packages and their current version number is
   something a machine should do, not a human.  Yet the Tycho OSGi
   way unfortunately demands that a human do this work.

 * OSGi bundle import data management is tedious

   There isn't a way in the MANIFEST.MF file format to reuse the
   same version tags across all of our imports, but we want to have
   a consistent view of our dependencies when we compile JGit.

After wasting more than 2 full days trying to get Tycho to work,
I've decided its a lost cause right now.  We need to be chasing down
bugs and critical features, not trying to bridge the gap between
the stable Maven repository format and the undocumented P2 format
used only by Eclipse.

So, switch the build to use Apache Felix's maven-bundle-plugin.

This is the same plugin Jetty uses to produce their OSGi bundle
manifests, and is the same plugin used by the Apache Felix project,
which is an open-source OSGi runtime.  It has a reasonable number
of folks using it for production builds, and is running on top of
the stable Maven 2.x code base.

With this switch we get automatically generated MANIFEST.MF files
based on reasonably sane default rules, which reduces the amount
of things we have to maintain by hand.  When necessary, we can add
a few lines of XML to our POMs to tweak the output.

Our build artifacts are still fully compatible with Maven 2.x, so
any downstream consumers are still able to use our build products,
without stepping up to Maven 3.x.  Our artifacts are also valid as
OSGi bundles, provided they are organized on disk into a repository
that the runtime can read.

With maven-bundle-plugin the build runs offline, as much as Maven
2.x is able to run offline anyway, so we're able to return to a
distributed development environment again.

By generating MANIFEST.MF at the top level of each project (and
therefore outside of the target directory), we're still compatible
with Eclipse's PDE tooling.  Our projects can be imported as standard
Maven projects using the m2eclipse plugin, but the PDE will think
they are vaild plugins and make them available for plugin builds,
or while debugging another workbench.

This change also completely removes Tycho from the build.

Unfortunately, Tycho 0.6.0's pom-first dependency resolver is broken
when resolving a pom-first plugin bundle through a manifest-first
feature package, so bundle org.eclipse.jgit can't be resolved,
even though it might actually exist in the local Maven repository.

Rather than fight with Tycho any further, I'm just declaring it
plugina-non-grata and ripping it out of the build.

Since there are very few tools to build a P2 format repository, and
no documentation on how to create one without running the Eclipse
UI manually by poking buttons, I'm declaring that we are not going
to produce a P2 update site from our automated builds.

Change-Id: If7938a86fb0cc8e25099028d832dbd38110b9124
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-12-28 15:59:14 -08:00
Shawn O. Pearce 6f06be9bc2 tools/version.sh: Update embedded version numbers in build products
We can now use `tools/version.sh --release` to update the MANIFEST.MF
and Maven POM files with the current version number of this project,
so they appear in any build product created.

The counterpart --snapshot option be used to reset files to use
their natural *-SNAPSHOT and *.qualifier state during development.

We use a simple Bourne shell script with Perl calls because we
must edit both Maven pom.xml and OSGi bundle MANIFEST.MF in order
to store the correct data for our parallel build systems.  In the
future we should use a native Java solution which relies upon JGit
to compute the `git describe` portion.

Until we tag our first official release a "tagged snapshot" can be
made by creating an artifical annotated tag first:

  git tag -a -m "initial contribution" v0.5.1 046198cf5f21e5a63e8ec0ecde2ef3fe21db2eae
  tools/version.sh --release

Resulting in a version string like "0.5.1.50-ge16af83".

Change-Id: Ic2bbae75bf96fc8831324c62c2212131277f70e4
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-11-17 10:25:14 -08:00
Shawn O. Pearce add24f2a36 Standardize the source code formatter for Eclipse
We now supply an exported format description for anyone to import
into their own workbench, and all projects reference this style in
a consistent way.

Change-Id: Ic243544a761ef2db29025a89ba6bb932a3a3ce34
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-05 12:17:11 -07:00
Shawn O. Pearce baba6a3c28 Utility to graft old JGit history onto repository
This script can be executed by a developer to download and graft
on the old JGit history, from before we moved the project to the
eclipse.org namespace and the Eclipse Foundation servers.

Executing this script is only necessary if you need to run log or
blame past the migration boundary, and isn't always recommended when
it comes to pushing objects to a remote server.  As mentioned in the
script, it is best to use a specialized repository with this graft,
not your main work repository.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-09-29 17:03:34 -07:00