Skip to content

Commit

Permalink
* Gradleized project
Browse files Browse the repository at this point in the history
* updated cp-common-utils
* updated cp-openrf-utils
* bumped rev
  • Loading branch information
Fernando Hernandez committed Feb 23, 2015
1 parent 7c7af27 commit b26f715
Show file tree
Hide file tree
Showing 76 changed files with 1,821 additions and 894 deletions.
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
.DS_Store
core/lib
jena/lib
sesame/lib
build
dist
out
settings/ivy-cache
settings/repo
*.iml
*.iws
*.ipr
.idea
target

gradle.properties
.gradle
3 changes: 2 additions & 1 deletion ACKNOWLEDGEMENTS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ Manuel Blechschmidt
Ultan O'Carroll
Laurent Bihanic
Nicolas Delsaux
Adri�n Quintana
Adrian Quintana
Davide Sottara
Laurent Bihanic
Fernando Hernandez

Others who preferred not to be named: you know who you are.

Expand Down
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Change Log
Empire 0.9 (TBD)
=======================
* FIXED: Resolved perm-gen leak (issue #86)
* MODIFIED: Upgraded to Sesame 2.7.12, Guava 17, CP Utils 3.1.1 & CP OpenRDF Utils 2.0.4
* MODIFIED: Upgraded to Sesame 2.7.14, Guava 18, CP Utils 4.0 & CP OpenRDF Utils 3.0

Empire 0.8 (2013-09-30)
=======================
Expand Down
166 changes: 166 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
/*
* Copyright (c) 2009-2010 Clark & Parsia, LLC. <http://www.clarkparsia.com>
*
* Licensed 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.
*/

if (!project.hasProperty('stardogRepo')) {
throw new InvalidUserDataException("Url to Stardog repository is not defined." +
" Set up the property 'stardogRepo' in gradle.properties.")
}

apply plugin: 'java'
apply plugin: 'idea'

task wrapper(type: Wrapper) {
gradleVersion = '2.0'
distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}

ext {
projectVersion = "0.9.0"
projectDescription = "JPA implementation for RDF"
projectUrl = "https://github.com/mhgrove/Empire"
}

allprojects {
group = "com.clarkparsia.empire"
version = projectVersion
sourceCompatibility = '1.6'
targetCompatibility = '1.6'

repositories {
mavenCentral()
maven {
url stardogRepo
// todo: remove this once we go live
credentials {
username artifactoryUsername
password artifactoryPassword
}
}
}


}

subprojects {
apply plugin: "java"
apply plugin: "maven"

dependencies {
compile 'org.slf4j:slf4j-api:1.7.7'
compile 'org.slf4j:slf4j-jdk14:1.7.7'

testCompile 'junit:junit:4.8.2'
}

configurations {
// ignore
compile.dependencies.all { dep ->
if (dep instanceof ExternalModuleDependency
&& (dep.group == 'org.openrdf.sesame' || dep.group == 'com.complexible.common')) {
dep.exclude group: "junit"
}
}
}

sourceSets {
main {
java {
srcDir 'main/src'
}
resources {
srcDir 'main/resources'
}
}
test {
java {
srcDir 'test/src'
}
resources {
srcDir 'test/resources'
}
}
}

// create a 'tests' conf for importing test classes from other sub-projects
task testJar(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
from sourceSets.test.output
}

artifacts {
testRuntime testJar // include the tests of other subprojects
}

if (project.hasProperty('publishUrl')
&& project.hasProperty('artifactoryUser')
&& project.hasProperty('artifactoryPassword')) {

// this task is just so artifactory picks up the pom changes
task('uploadMvn', type: Upload) {
configuration = configurations.archives
repositories {
mavenDeployer {
repository(url: publishUrl)
pom.project {
name = archivesBaseName
packaging = 'jar'
description projectDescription
url projectUrl
}

//mess with the generated pom to remove test dependencies from published artifacts
pom.withXml { XmlProvider xmlProvider ->
def xml = xmlProvider.asString()
def pomXml = new XmlParser().parse(new ByteArrayInputStream(xml.toString().bytes))

pomXml.dependencies.dependency.each { dep ->
if (dep.scope.text() != 'compile') {
def parent = dep.parent()
parent.remove(dep)
}
}

def newXml = new StringWriter()
def printer = new XmlNodePrinter(new PrintWriter(newXml))
printer.preserveWhitespace = true
printer.print(pomXml)
xml.setLength(0)
xml.append(newXml.toString())
}

}
}
}
}
}

evaluationDependsOnChildren()

subprojects {
task javadocs(type: Javadoc) {
source sourceSets.main.allJava
classpath = configurations.compile
destinationDir = file("${rootProject.buildDir}/javadocs/${project.name}")
configure(options) {
windowTitle "${project.archivesBaseName}-${project.version} API"
docTitle "${project.archivesBaseName}-${project.version}"
bottom "Copyright &#169; 2010-2015 Complexible. All Rights Reserved."
links "http://docs.oracle.com/javase/6/docs/api/",
"http://docs.guava-libraries.googlecode.com/git-history/v17.0/javadoc/"
}
}
}


58 changes: 58 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2009-2010 Clark & Parsia, LLC. <http://www.clarkparsia.com>
*
* Licensed 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.
*/

dependencies {
// make sure to have the $JAVA_HOME env variable declared in your system
compile files("${System.properties['java.home']}/../lib/tools.jar")

compile "org.javassist:javassist:3.17.1-GA"
compile "org.ow2.spec.ee:ow2-jpa-1.0-spec:1.0.12"

compile "com.complexible.common:cp-common-utils:4.0"

compile "com.complexible.common:cp-openrdf-utils:3.0"

compile "commons-dbcp:commons-dbcp:1.3"

compile ("com.google.guava:guava:18.0") {
exclude group: "com.google.code.findbugs"
}

compile ("org.openrdf.sesame:sesame-runtime:2.7.12") {
exclude group: "org.slf4j"
}
compile ("org.openrdf.sesame:sesame-queryrender:2.7.12") {
exclude group: "org.slf4j"
}
compile ("org.openrdf.sesame:sesame-queryparser-serql:2.7.12") {
exclude group: "org.slf4j"
}

// Guice and related
compile "com.google.inject:guice:3.0"
compile "com.google.inject.extensions:guice-multibindings:3.0"
compile "com.google.inject.extensions:guice-assistedinject:3.0"
compile "com.google.inject.extensions:guice-throwingproviders:3.0"
compile "aopalliance:aopalliance:1.0"
}

test {
workingDir = projectDir
// debug = true // for attaching the IDE to the gradle cli

// set JVM arguments for the test JVM(s)
jvmArgs '-XX:MaxPermSize=256m', '-enableassertions'
include"**/TestEmpireCore.class"
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

package com.clarkparsia.empire.codegen;

import com.clarkparsia.empire.util.Repositories2;
import com.complexible.common.collect.Iterables2;
import com.complexible.common.collect.Iterators2;
import com.complexible.common.openrdf.model.Statements;
Expand Down Expand Up @@ -438,7 +439,7 @@ private static String className(Resource theClass) {
public static void generateSourceFiles(String thePackageName, URL theOntology, RDFFormat theFormat, File theDirToSave) throws Exception {
NAMES_TO_COUNT.clear();

Repository aRepository = Repositories.createInMemoryRepo();
Repository aRepository = Repositories2.createInMemoryRepo();

Repositories.add(aRepository, theOntology.openStream(), theFormat);

Expand Down
37 changes: 37 additions & 0 deletions core/main/src/com/clarkparsia/empire/util/Repositories2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.clarkparsia.empire.util;

import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.sail.SailRepository;
import org.openrdf.sail.memory.MemoryStore;

/**
* @author Fernando Hernandez
* @since 0.8.7
* @version 0.8.7
*/
public class Repositories2 {

private Repositories2() {
throw new AssertionError();
}

/**
* Create a simple in-memory {@link Repository} which is already initialized
*
* @return an in memory Repository
*/
public static Repository createInMemoryRepo() {
try {
Repository aRepo = new SailRepository(new MemoryStore());

aRepo.initialize();

return aRepo;
}
catch (RepositoryException e) {
// impossible?
throw new AssertionError(e);
}
}
}
Loading

0 comments on commit b26f715

Please sign in to comment.