Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to publishing non-delomboked sources #1788

Merged
merged 7 commits into from
Nov 27, 2019
Merged

Conversation

rnorth
Copy link
Member

@rnorth rnorth commented Aug 25, 2019

Overview

  • Switch to publishing non-delomboked sources
  • Delomboked sources are available under the 'sources-delomboked' classifier

JAR content example

$ rm -r ~/.m2/repository/org/testcontainers/
$ ./gradlew publishToMavenLocal -x test --info

# Note that the default version number is 'unspecified'

$ ll ~/.m2/repository/org/testcontainers/testcontainers/unspecified/
total 25400
-rw-r--r--  1 richardnorth  staff   485K 23 Aug 10:00 testcontainers-unspecified-javadoc.jar
-rw-r--r--  1 richardnorth  staff   147K 23 Aug 10:00 testcontainers-unspecified-sources-delomboked.jar
-rw-r--r--  1 richardnorth  staff   135K 23 Aug 10:04 testcontainers-unspecified-sources.jar
-rw-r--r--  1 richardnorth  staff    12M 25 Aug 19:46 testcontainers-unspecified.jar
-rw-r--r--  1 richardnorth  staff   3.4K 25 Aug 19:46 testcontainers-unspecified.pom

Example file content

testcontainers-unspecified-sources.jar org.testcontainers.containers.SelinuxContext
package org.testcontainers.containers;

import com.github.dockerjava.api.model.SELContext;
import lombok.AllArgsConstructor;

/**
 * Possible contexts for use with SELinux
 */
@AllArgsConstructor
public enum SelinuxContext {
    SHARED(SELContext.shared),
    SINGLE(SELContext.single),
    NONE(SELContext.none);

    public final SELContext selContext;

}
testcontainers-unspecified-sources-delomboked.jar org.testcontainers.containers.SelinuxContext
// Generated by delombok at Fri Aug 23 10:00:38 BST 2019
package org.testcontainers.containers;

import com.github.dockerjava.api.model.SELContext;

/**
 * Possible contexts for use with SELinux
 */
public enum SelinuxContext {
    SHARED(SELContext.shared), SINGLE(SELContext.single), NONE(SELContext.none);
    public final SELContext selContext;

    @java.lang.SuppressWarnings("all")
    private SelinuxContext(final SELContext selContext) {
        this.selContext = selContext;
    }
}

Debugging example

Working in a codebase that uses Testcontainers as a dependency, after manually setting IntelliJ to use the new sources JAR (only needed before this PR is released):
image

IntelliJ complains, but debugging is vastly easier:
image

Outcomes:

  • it is possible to step-debug through all Testcontainers code, included generated Lombok code
  • IntelliJ warns that Library source does not match the bytecode
  • IntelliJ also shows broken imports for Lombok classes and for shade-relocated dependencies

However, I believe that the latter two problems are tolerable given that debugging is now significantly eased.

Delomboked sources are available under the 'sources-delomboked' classifier
@rnorth
Copy link
Member Author

rnorth commented Aug 25, 2019

@bsideup, @kiview when reviewing this please look carefully - I'd suggest trying out the current debugging experience once, then repeat using source JARs generated using this branch's build script.

We should also take care during release, to make sure all the expected JARs get published through bintray and maven central.

gradle/publishing.gradle Outdated Show resolved Hide resolved
@rnorth rnorth added this to the next milestone Sep 8, 2019
@rnorth rnorth requested a review from bsideup October 12, 2019 15:44
@bsideup bsideup modified the milestones: 1.12.3, next Oct 26, 2019
@rnorth rnorth self-assigned this Nov 1, 2019
@rnorth rnorth merged commit 6b15846 into master Nov 27, 2019
@delete-merged-branch delete-merged-branch bot deleted the publish-lombok-sources branch November 27, 2019 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants