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

Groovy 3.x upgrade and changed dependecy to gradle. #95

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .classpath

This file was deleted.

74 changes: 73 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,75 @@
target/
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
.idea/artifacts
.idea/compiler.xml
.idea/jarRepositories.xml
.idea/modules.xml
.idea/*.iml
.idea/modules
*.iml
*.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
build/
.gradle/
.idea/
target/
29 changes: 0 additions & 29 deletions .project

This file was deleted.

4 changes: 0 additions & 4 deletions .settings/org.codehaus.groovy.eclipse.preferences.prefs

This file was deleted.

6 changes: 0 additions & 6 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions .settings/org.eclipse.mylyn.tasks.ui.prefs

This file was deleted.

48 changes: 42 additions & 6 deletions README → README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
HTTPBuilder = Easy HTTP client for Groovy.
## HTTPBuilder = Easy HTTP client for Groovy.

Build Instructions:

HTTPBuilder is built using Apache Maven (http://maven.apache.org)
$ mvn install
HTTPBuilder is built using Gradle (https://gradle.org/)

$ ./gradlew publishToMavenLocal

Documentation: https://github.com/jgritman/httpbuilder/wiki

Contributions:
### Installation
Add dependency to your build.gradle

```
repositories {
...
maven { url "https://jitpack.io" }
}

dependencies {
compile 'com.github.jgritman:httpbuilder:1.0-M1-snapshot'
}
```

In addition if you don't want to use jitpack.io then use following github package registry:

```groovy
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/jgritman/httpbuilder")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}

dependencies {
compile 'org.codehaus.groovy.modules.http-builder:http-builder:1.0-M1-snapshot'
}

```


### Contributions:

This project relies on the work of many open source projects including:
* Groovy: http://groovy.codehaus.org
* Groovy: http://groovy-lang.org
* Apache HttpClient: http://hc.apache.org
* Json-Lib: http://json-lib.sourceforge.net/
* Neko HTML: http://nekohtml.sourceforge.net/
Expand All @@ -21,7 +57,7 @@ Contributions:
re-distributed with permission from the author.


License:
### License:

HTTPBuilder is copyright 2009-2011 Thomas Nichols except where otherwise noted.

Expand Down
133 changes: 133 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
buildscript {
repositories {
mavenLocal()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.gorylenko.gradle-git-properties:gradle-git-properties:2.3.2"
}
}

plugins {
id 'groovy'
}

apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: "com.gorylenko.gradle-git-properties"

group 'org.codehaus.groovy.modules.http-builder'
version '1.0-M1-snapshot'

sourceCompatibility = 1.8

repositories {
mavenLocal()
mavenCentral()
maven { url "https://repo1.maven.org/maven2/" }
}

dependencies {
compile "org.apache.httpcomponents:httpclient:4.2.6"
compile 'net.sf.json-lib:json-lib:2.4:jdk15'
compile "org.codehaus.groovy:groovy-json:${groovyVersion}"
compile "org.codehaus.groovy:groovy-xml:${groovyVersion}"
compile "org.codehaus.groovy:groovy:${groovyVersion}"
compile "net.sourceforge.nekohtml:nekohtml:1.9.16"
compile "xml-resolver:xml-resolver:1.2"
compile "oauth.signpost:signpost-commonshttp4:1.2.1.1"
compile "oauth.signpost:signpost-core:1.2.1.1"
compile "com.google.appengine:appengine-api-1.0-sdk:1.3.8"
compile "xerces:xercesImpl:[2.6.2,)"
testCompile "log4j:log4j:1.2.16"
testCompile "commons-io:commons-io:1.4"
testCompile "junit:junit:4.5"
compile "com.anasoft.os:m2st-doxia-macros:${m2stVersion}"
compile "org.apache.maven.doxia:doxia-sink-api:1.1.3"
compile "org.apache.maven.doxia:doxia-core:1.1.3"
}


javadoc {
source = sourceSets.main.allJava
classpath = configurations.compileClasspath

options
{
setMemberLevel JavadocMemberLevel.PUBLIC
setAuthor true

links "https://docs.oracle.com/javase/8/docs/api/"
}
}

gitProperties {
keys = ['git.branch', 'git.commit.id', 'git.commit.time', 'git.commit.id.abbrev']
failOnNoGitDirectory = true
extProperty = 'gitProps' // git properties will be put in a map at project.ext.gitProps
}

generateGitProperties.outputs.upToDateWhen {
false
} // make sure the generateGitProperties task always executes (even when git.properties is not changed)

jar {
dependsOn generateGitProperties
manifest {
attributes("Built-By": System.getProperty("user.name"))
attributes(["Plugin-Version" : version,
"Plugin-Title" : project.name,
"Plugin-Build-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Git-Commit" : "${-> project.ext.gitProps['git.commit.id.abbrev']}",
"Git-Branch" : "${-> project.ext.gitProps['git.branch']}"])
}
from sourceSets.main.output
exclude 'git.properties'
}

task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}

task packageJavadoc(type: Jar) {
from javadoc
classifier = 'javadoc'
}

tasks.withType(Javadoc) {
failOnError false
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}


publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/jgritman/httpbuilder")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
maven {
name = "NexusRepo"
credentials {
username project.findProperty("nexusUsername") ?: System.getenv("NEXUS_USERNAME")
password project.findProperty("nexusPassword") ?: System.getenv("NEXUS_PASSWORD")
}
url project.findProperty("nexusUrl") ?: System.getenv("NEXUS_URL")
}
}

publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar
artifact packageJavadoc
}
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
groovyVersion = 3.0.8
m2stVersion = 2.0
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading