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

Merge tests and pom and code #515

Merged
merged 395 commits into from
May 22, 2020

Conversation

BGehrels
Copy link
Contributor

@BGehrels BGehrels commented Apr 29, 2020

Until now, we have had a quite unhappy situation:

  • We have one repository containing the source code
  • We have another repository containing the test code (having a different license)
  • We have a third repository containing code that glues all those together, builds a release jar and deploys it to maven central.

As a result, we have

  • Unnneccessary handovers between repository owners
  • high entry barriers for contributors, because the code is scattered between repos in a non-java-standard way
  • unhappy contributors, because i (as the owner of the third repo) do not have the time to engage into discussions and PRs regarding JAR formats, Release versions, etrc
  • me being a blocker here, because is basically do not work with Java professionally right now and have no clue about java 9+ and the module system and therefore are unable to reliably test the changes to the release process that @GedMarc, @renatoathaydes and others have proposed in the past
  • Unneccessary delays when releases are needed as i need to be available to release a projects which i have no stakes in at all right now
  • a hard time implementing things like Githubs CI/CD usign actions because stuff is split into three repos

So: this PR unifies all those three repos into one.

  • I tried to preserve the history of the test repo (git magic ftw)
  • I moved the project files into standard maven folder structure
  • I added the POM file that i usually use to release the project
  • We could move the test files into the org.json package. Tests being in the same pacakge as sources is somehow convention. Your call.
  • I created a mixed license file for both parts: src/main with the old org.json license, src/test with apache 2.

Whats left to do afterwards:

  • We need to hand over the release permissions for maven central to @stleary

Side note:
For some reason, github shows a lot of files as changed that do not show changes locally (apart from being moved). I don't know why.

stleary and others added 30 commits June 17, 2015 20:11
Document bigInt and bigDec behavior to determine what can be changed
…ent. (Will currently assterted to an Exception).
…ing_conversion_to_XML

Showing issue of illegal node names with possible underscore-replacement. (Will currently assterted to an Exception).
@stleary
Copy link
Owner

stleary commented Apr 30, 2020

I think the licensing isn't a real issue. It could just be added to headers of each file and note that all new test changes will be under the JSON License. The tests aren't released in the maven library anyway.

Agreed, it's just a matter of replacing the unit test license with the lib license. This can be done at any time between the commit and the next release. We haven't done alpha releases yet, but this may be a good candidate.

I don't think updating the gradle build is an issue. We can switch to a maven build like the release had and move forward using maven.

Getting Gradle to work should be trivial, no? No objection going forward to support build mechanisms like Maven as long as it can be done in a way that does not impact existing users.

I think we can say that anyone using <java8 needs to use an old release of this lib. After this merge, let's move to a java8+ model. API should still stay stable for Android comparability.

The lib code is already Java 7 compatible, we just need to backport the unit test code to run in Java7 too. I think (hope) that can be done without significant loss of coverage.

@BGehrels
Copy link
Contributor Author

Regarding the unit tests:
I Already took care to make sure they still run fine:

> mvn test
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] ---------------------------< org.json:json >----------------------------
[INFO] Building JSON in Java v20200429-SNAPSHOT
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven) @ json ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ json ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Benjamin Gehrels\JSON-java\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ json ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ json ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ json ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.0:test (default-test) @ json ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.json.junit.CDLTest
MessageBad character 'V' (86). at 20 [character 9 line 2]
[INFO] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.137 s - in org.json.junit.CDLTest
[INFO] Running org.json.junit.CookieListTest
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.054 s - in org.json.junit.CookieListTest
[INFO] Running org.json.junit.CookieTest
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 s - in org.json.junit.CookieTest
[INFO] Running org.json.junit.EnumTest
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 s - in org.json.junit.EnumTest
[INFO] Running org.json.junit.HTTPTest
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s - in org.json.junit.HTTPTest
[INFO] Running org.json.junit.JSONArrayTest
[INFO] Tests run: 30, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.018 s - in org.json.junit.JSONArrayTest
[INFO] Running org.json.junit.JSONMLTest
[INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 s - in org.json.junit.JSONMLTest
[INFO] Running org.json.junit.JSONObjectLocaleTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in org.json.junit.JSONObjectLocaleTest
[INFO] Running org.json.junit.JSONObjectTest
new BigDecimal(testData[]) : 102 ms
NUMBER_PATTERN.matcher(testData[]).matches() : 86 ms
[INFO] Tests run: 80, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.361 s - in org.json.junit.JSONObjectTest
[INFO] Running org.json.junit.JSONPointerTest
[INFO] Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.02 s - in org.json.junit.JSONPointerTest
[INFO] Running org.json.junit.JSONStringerTest
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 s - in org.json.junit.JSONStringerTest
[INFO] Running org.json.junit.JSONStringTest
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in org.json.junit.JSONStringTest
[INFO] Running org.json.junit.JSONTokenerTest
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 s - in org.json.junit.JSONTokenerTest
[INFO] Running org.json.junit.PropertyTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.025 s - in org.json.junit.PropertyTest
[INFO] Running org.json.junit.XMLConfigurationTest
[INFO] Tests run: 30, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.61 s - in org.json.junit.XMLConfigurationTest
[INFO] Running org.json.junit.XMLTest
[INFO] Tests run: 33, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.093 s - in org.json.junit.XMLTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 313, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.520 s
[INFO] Finished at: 2020-04-30T12:18:34+02:00
[INFO] ------------------------------------------------------------------------

@BGehrels
Copy link
Contributor Author

If you plan to switch to gradle as a build tool, you'll find a tutorial for the maven central deployment here:
https://central.sonatype.org/pages/gradle.html

@stleary
Copy link
Owner

stleary commented Apr 30, 2020

@BGehrels FYI I reached out to you via email found on your gehrels.info page, regarding Maven Central permissions.

@stleary
Copy link
Owner

stleary commented Apr 30, 2020

Regarding the unit tests:
I Already took care to make sure they still run fine:

Confirmed, thanks.

@stleary
Copy link
Owner

stleary commented May 4, 2020

@BGehrels Hi, I need to hear back from you regarding Maven Central. It's the only item blocking this PR.

@johnjaylward
Copy link
Contributor

YEAH! Thanks @BGehrels and @stleary!

@BGehrels BGehrels deleted the merge-tests-and-pom-and-code branch May 22, 2020 15:48
This was referenced Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.