-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from Qualytics/master
Refactor this repo for modernity
- Loading branch information
Showing
22 changed files
with
142 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build this project with gradle | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build-gradle-project: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: openvenues/libpostal | ||
path: libpostal | ||
- name: Install libtool | ||
run: | | ||
cd libpostal | ||
./bootstrap.sh | ||
mkdir data_dir | ||
./configure --datadir=`pwd`/data_dir MODEL=senzing | ||
sudo make -j4 | ||
sudo make install | ||
sudo ldconfig | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: Qualytics/jpostal | ||
path: jpostal | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Run build with Gradle Wrapper | ||
run: | | ||
cd jpostal | ||
./gradlew check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,64 @@ | ||
apply plugin: 'java' | ||
import org.gradle.internal.jvm.Jvm | ||
|
||
plugins { | ||
id 'c' | ||
id 'java' | ||
id 'application' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
task buildJniLib(type:Exec) { | ||
commandLine './build.sh' | ||
sourceSets.main.java.srcDirs = ["src/main/java"] | ||
sourceSets.test.java.srcDirs = ["src/test/java"] | ||
|
||
model { | ||
platforms { | ||
x64 { | ||
architecture "x86_64" | ||
} | ||
} | ||
|
||
components { | ||
jpostal(NativeLibrarySpec) { | ||
binaries.all { | ||
def jvmHome = org.gradle.internal.jvm.Jvm.current().javaHome | ||
if (targetPlatform.operatingSystem.macOsX) { | ||
cCompiler.args '-I', "${jvmHome}/include" | ||
cCompiler.args '-I', "${jvmHome}/include/darwin" | ||
cCompiler.args '-mmacosx-version-min=10.9' | ||
linker.args '-mmacosx-version-min=10.9' | ||
linker.args '-stdlib=libc++' | ||
} else if (targetPlatform.operatingSystem.linux) { | ||
cCompiler.args '-I', "${jvmHome}/include" | ||
cCompiler.args '-I', "${jvmHome}/include/linux" | ||
cCompiler.args '-D_FILE_OFFSET_BITS=64' | ||
} else if (targetPlatform.operatingSystem.windows) { | ||
cCompiler.args "-I${jvmHome}/include" | ||
cCompiler.args "-I${jvmHome}/include/win32" | ||
} else if (targetPlatform.operatingSystem.freeBSD) { | ||
cCompiler.args '-I', "${jvmHome}/include" | ||
cCompiler.args '-I', "${jvmHome}/include/freebsd" | ||
} | ||
linker.args '-lpostal' // Link with libpostal | ||
} | ||
} | ||
} | ||
} | ||
|
||
classes.dependsOn 'jpostalSharedLibrary' | ||
|
||
|
||
application { | ||
applicationDefaultJvmArgs = ["-Djava.library.path=" + file("${buildDir}/libs/jpostal/shared").absolutePath] | ||
} | ||
|
||
compileJava.dependsOn(buildJniLib) | ||
|
||
dependencies { | ||
testCompile 'junit:junit:4.+' | ||
testImplementation 'junit:junit:4.+' | ||
} | ||
|
||
tasks.withType(Test) { | ||
systemProperty "java.library.path", "src/main/jniLibs" | ||
systemProperty "java.library.path", file("${buildDir}/libs/jpostal/shared").absolutePath | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# | ||
# Install [libpostal](https://github.com/openvenues/libpostal) on a base image with a JDK | ||
# to support automated builds of the jpostal project | ||
# | ||
# Note: An image built with this dockerfile is available publicly on Dockerhub as qualytics42/qualytics-jpostal-base:0.1.0 | ||
# built with `docker buildx build --platform linux/arm64,linux/amd64 .` on a M1 Mac | ||
# | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
FROM cimg/openjdk:17.0 | ||
|
||
USER 0 | ||
|
||
RUN set -ex; \ | ||
mkdir -p /home; \ | ||
cd /home; \ | ||
apt-get update; \ | ||
apt-get install -y build-essential curl autoconf automake libtool pkg-config git zip; \ | ||
git clone https://github.com/openvenues/libpostal; \ | ||
cd libpostal; \ | ||
./bootstrap.sh; \ | ||
mkdir data_dir; \ | ||
# ./configure --datadir=`pwd`/data_dir MODEL=senzing; \ | ||
# sse2 is not available when building on M1 Mac | ||
./configure --datadir=`pwd`/data_dir MODEL=senzing --disable-sse2; \ | ||
make -j4; \ | ||
make install; \ | ||
chown -R circleci ../libpostal \ | ||
ldconfig; | ||
|
||
USER circleci |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#Fri Feb 19 02:42:10 EST 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip |
Oops, something went wrong.