Skip to content

Commit

Permalink
Migrate all common over to core to remove dependencies between core a…
Browse files Browse the repository at this point in the history
…nd extended
  • Loading branch information
gem-neo4j committed Dec 4, 2024
1 parent f6a13c9 commit 3df0d59
Show file tree
Hide file tree
Showing 221 changed files with 562 additions and 211 deletions.
1 change: 0 additions & 1 deletion benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ repositories {
}

dependencies {
jmh project(':common')
jmh project(':core')
jmh "com.neo4j:neo4j-enterprise:$neo4jVersionEffective"
jmh "org.neo4j:neo4j:$neo4jVersionEffective"
Expand Down
159 changes: 0 additions & 159 deletions common/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion common/src/test/resources/csv-inputs/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions common/src/test/resources/person.json

This file was deleted.

33 changes: 31 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,17 @@ dependencies {
apt project(':processor')
apt group: 'org.neo4j', name: 'neo4j', version: neo4jVersionEffective

def withoutServers = {
exclude group: 'org.eclipse.jetty'
exclude group: 'org.eclipse.jetty.aggregate'
exclude group: 'org.apache.hive', module: 'hive-service'
}

// These will be dependencies packaged with the .jar
implementation project(":common")
implementation group: 'com.jayway.jsonpath', name: 'json-path', version: '2.9.0'
implementation group: 'org.hdrhistogram', name: 'HdrHistogram', version: '2.1.9'
// We need this to avoid seeing SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" on startup
api group: 'org.slf4j', name: 'slf4j-api', version: '2.0.9'
implementation group: 'com.opencsv', name: 'opencsv', version: '5.7.1', {
exclude group: 'commons-beanutils', module: 'commons-beanutils'
exclude group: 'org.apache.commons', module: 'commons-collections4'
Expand All @@ -59,12 +68,25 @@ dependencies {

compileOnly group: 'org.neo4j', name: 'neo4j', version: neo4jVersionEffective
compileOnly group: 'com.google.guava', name: 'guava', version: '33.0.0-jre'
compileOnly group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.12.643'

// If updated check if the transitive dependency to javax.servlet.jsp:jsp-api:2.1 has also updated
// and remove the manual licensing check for it in licenses-3rdparties.gradle
compileOnly group: 'org.apache.hadoop', name: 'hadoop-common', version: '3.4.0', withoutServers
compileOnly group: 'com.google.cloud', name: 'google-cloud-storage', version: '2.26.1'
compileOnly group: 'com.github.seancfoley', name: 'ipaddress', version: '5.3.3'
compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0'

// These dependencies affect the tests only, they will not be packaged in the resulting .jar
testImplementation project(":common").sourceSets.test.output
testImplementation project(':test-utils')
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.19.0'
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
testImplementation group: 'org.neo4j.community', name: 'it-test-support', version: neo4jVersionEffective // , classifier: "tests"
testImplementation group: 'org.neo4j', name: 'log-test-utils', version: neo4jVersionEffective // , classifier: "tests"
testImplementation group: 'org.neo4j', name: 'neo4j-kernel', version: neo4jVersionEffective, classifier: "tests"
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
testImplementation group: 'pl.pragmatists', name: 'JUnitParams', version: '1.1.1'
testImplementation group: 'org.mock-server', name: 'mockserver-netty', version: '5.15.0', {
exclude group: 'org.slf4j', module: 'slf4j-api'
}
Expand All @@ -73,9 +95,16 @@ dependencies {
configurations.all {
exclude group: 'org.slf4j', module: 'slf4j-nop'
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'org.ow2.asm', module: 'asm'
}
}

tasks.register('testJar', Jar) {
dependsOn testClasses
archiveClassifier = 'tests'
from sourceSets.test.output
}

publishing {
repositories {
maven {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
import java.util.Iterator;
import java.util.List;

/**
* @author mh
* @since 29.05.16
*/
public class ConvertUtils {
@SuppressWarnings("unchecked")
public static List convertToList(Object list) {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package apoc.graph.document.builder;
package apoc.graph;

import apoc.graph.util.GraphsConfig;
import apoc.result.VirtualGraph;
import apoc.result.VirtualNode;
import apoc.util.FixedSizeStringWriter;
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/apoc/graph/Graphs.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static apoc.graph.GraphsUtils.extract;

import apoc.cypher.CypherUtils;
import apoc.graph.document.builder.DocumentToGraph;
import apoc.graph.util.GraphsConfig;
import apoc.result.RowResult;
import apoc.result.VirtualGraph;
import apoc.util.Util;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package apoc.graph.util;
package apoc.graph;

import static apoc.util.Util.toBoolean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package apoc.graph.document.builder;
package apoc.graph;

import static org.apache.commons.text.WordUtils.capitalizeFully;

import apoc.graph.util.GraphsConfig;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package apoc.graph.document.builder;
package apoc.graph;

import apoc.graph.util.GraphsConfig;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions core/src/main/java/apoc/load/Xml.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import apoc.ApocConfig;
import apoc.export.util.CountingInputStream;
import apoc.generate.config.InvalidConfigException;
import apoc.result.LoadDataMapResult;
import apoc.util.CompressionAlgo;
import apoc.util.CompressionConfig;
Expand Down Expand Up @@ -454,7 +453,7 @@ public XmlImportConfig(Map<String, Object> config) {
}

if (config.containsKey("createNextWordRelationships")) {
throw new InvalidConfigException(
throw new RuntimeException(
"usage of `createNextWordRelationships` is no longer allowed. Use `{relType:'NEXT_WORD', label:'XmlWord'}` instead.");
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package apoc.xml;
package apoc.util.xml;

import static apoc.util.MapUtil.map;
import static java.util.Arrays.asList;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion core/src/test/java/apoc/graph/GraphsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import static org.junit.Assert.assertFalse;
import static org.neo4j.graphdb.Label.label;

import apoc.graph.util.GraphsConfig;
import apoc.util.JsonUtil;
import apoc.util.TestUtil;
import apoc.util.Util;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package apoc.graph.document.builder;
package apoc.graph.builder;

import static org.junit.Assert.assertEquals;

import apoc.graph.util.GraphsConfig;
import apoc.graph.DocumentToGraph;
import apoc.graph.GraphsConfig;
import apoc.result.VirtualGraph;
import apoc.result.VirtualNode;
import apoc.result.VirtualRelationship;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package apoc.graph.document.builder;
package apoc.graph.builder;

import static org.hamcrest.MatcherAssert.assertThat;

import apoc.graph.util.GraphsConfig;
import apoc.graph.GraphsConfig;
import apoc.graph.LabelBuilder;
import apoc.util.MapUtil;
import java.util.HashMap;
import java.util.Map;
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/apoc/load/XmlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import apoc.util.TransactionTestUtil;
import apoc.util.collection.Iterables;
import apoc.util.collection.Iterators;
import apoc.xml.XmlTestUtils;
import apoc.util.xml.XmlTestUtils;
import com.sun.net.httpserver.HttpContext;
import com.sun.net.httpserver.HttpServer;
import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import org.neo4j.graphdb.schema.ConstraintType;
import org.neo4j.graphdb.schema.IndexType;

public class UtilTest {
public class UtilTestCommon {

/**
* If any new constraints or indexes are added, this test will fail.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void callToIteratorShouldCreateNewIterators(int numberOfIterators) {
@Override
protected ResourceIterator<Integer> newIterator() {
iteratorCount.increment();
return resourceIterator(asIterator(0), Resource.EMPTY);
return resourceIterator(asIterator(0), EMPTY);
}

@Override
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3df0d59

Please sign in to comment.