Skip to content

Commit

Permalink
add jdk6 compatibility check
Browse files Browse the repository at this point in the history
  • Loading branch information
xvik committed Oct 7, 2014
1 parent e5a3411 commit e101e79
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 66 deletions.
138 changes: 135 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,141 @@
*.class
.idea/
*.iml
# Created with https://www.gitignore.io

### Gradle ###
.gradle/
build/

# Ignore Gradle GUI config
gradle-app.setting

### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm

/*.iml

## Directory-based project format:
.idea/

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml


### Eclipse ###
*.pydevproject
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath

# sbteclipse plugin
.target

# TeXlipse plugin
.texlipse

### Java ###
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*


### NetBeans ###
nbproject/private/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml


### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk


### Linux ###
*~

# KDE directory preferences
.directory
17 changes: 9 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ description = 'Dropwizard guice integration'

// convention: project.name == github project name == bintray package page
project.ext {
build = {
gradle = 2.1
java = 1.6
// if not empty runs animal sniffer on compile to guarantee binary compatibility; set '' to disable
signature = 'org.codehaus.mojo.signature:java16-sun:+@signature'
}
github = {
user = 'xvik'
}
Expand All @@ -20,7 +26,8 @@ project.ext {
tags = ['dropwizard','guice']
dryRun = false // whether to run this as dry-run, without deploying (TEST RUN)
publish = true //If version should be auto published after an upload
signFiles = true // true to sign files on bintray (certificate must be installed on bintray account)
signFiles = true // true to gpg sign files on bintray (certificate must be installed on bintray account)
gpgPassphrase = project.hasProperty('gpgPassphrase') ? gpgPassphrase : '' // optionally configured in ~/.gradle/gradle.properties if certificate requires it
}
license = 'MIT'
licenseDesc = 'The MIT License'
Expand Down Expand Up @@ -53,9 +60,7 @@ apply plugin: 'groovy'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'project-report'

sourceCompatibility = 1.6
targetCompatibility = 1.6

apply from: 'gradle/build.gradle'
apply from: 'gradle/github.gradle'
apply from: 'gradle/bintray.gradle'
apply from: 'gradle/release.gradle'
Expand Down Expand Up @@ -85,10 +90,6 @@ dependencies {
testCompile 'cglib:cglib-nodep:2.2.2'
}

task wrapper(type: Wrapper) {
gradleVersion = '2.1'
}

task checkOutOfDate(type: DependencyUpdatesTask, description: 'Checks dependencies updates availability') {
revision 'release'
}
Expand Down
52 changes: 7 additions & 45 deletions gradle/bintray.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
import org._10ne.gradle.rest.RestTask

buildscript {
apply from: "gradle/buildscript.gradle", to: buildscript
}

apply plugin: 'com.jfrog.bintray'
apply plugin: 'org.10ne.rest'

// hack: without it bintray property is not visible (???!)
logger.debug("$project.ext.bintray")
def bintrayCfg = project.ext.bintray

def bitrayApiUrl = "https://api.bintray.com"
// bintray will not accept snapshot versions, so its safe to fix version manually
bintrayCfg.signApiUrl = ("$bitrayApiUrl/gpg/$bintrayCfg.user/$bintrayCfg.repo/$project.name/versions/$project.version".replace('-SNAPSHOT',''))
bintrayCfg.publishApiUrl = ("$bitrayApiUrl/content/$bintrayCfg.user/$bintrayCfg.repo/$project.name/$project.version/publish".replace('-SNAPSHOT',''))

bintray {
user = bintrayCfg.user
key = bintrayCfg.key
Expand All @@ -32,37 +20,11 @@ bintray {
vcsUrl = github.scm
licenses = [license]
labels = bintrayCfg.tags
version {
gpg {
sign = bintrayCfg.signFiles
passphrase = bintrayCfg.gpgPassphrase
}
}
}
}

// no way to do it from web ui and bintray plugin doesn't support it
// NOTE: files wil remain unpublished so go to bintray and publish them, after that do maven central sync (on web ui)
task bintraySignVersion(type: RestTask, description: 'Sign version files (auto sign bintray feature') {
httpMethod = 'post'
uri = bintray.signApiUrl
username = bintray.user
password = bintray.key
}
bintraySignVersion.doFirst {
// cancel task in dry run mode
if (bintray.dryRun) {
logger.warn('Skipping version signing in dry run mode')
throw new StopExecutionException()
}
}

task bintraySign(type: RestTask, dependsOn: 'bintraySignVersion', description: 'Sign version files and publish sign files') {
httpMethod = 'post'
uri = bintray.publishApiUrl
username = bintray.user
password = bintray.key
}
bintraySign.doFirst {
// cancel task in dry run mode
if (bintray.dryRun) {
logger.warn('Skipping version publishing in dry run mode')
throw new StopExecutionException()
}
}

bintraySign.mustRunAfter bintrayUpload
}
27 changes: 27 additions & 0 deletions gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// hack: without it build property is not visible (???!)
logger.debug("$project.ext.build")
def buildCfg = project.ext.build

// compatibility required only for main classes - test don't need restrictions
compileJava {
sourceCompatibility = buildCfg.java
targetCompatibility = buildCfg.java
}

boolean signatureSet = buildCfg.signature
if (signatureSet) {
apply plugin: 'be.insaneprogramming.gradle.animalsniffer'

animalsniffer {
signature = buildCfg.signature
ignores = [] // list of packages to ignore
annotations = [] // supported annotations to signal Animal Sniffer to ignore annotated elements
excludeDependencies = true // only disable if you have signatures for all dependencies!
skip = false // skip animal sniffer tasks
runForTests = false // run animal sniffer for test classes as well
}
}

task wrapper(type: Wrapper) {
gradleVersion = buildCfg.gradle
}
7 changes: 3 additions & 4 deletions gradle/buildscript.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ repositories {
}
dependencies {
// bintray upload
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5"
// rest support to call some bintray api methods directly
classpath "org._10ne.gradle:rest-gradle-plugin:0.3.1"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:0.6"
// coveralls integration
classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.0"
classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1"
// check dependencies updates
classpath "com.github.ben-manes:gradle-versions-plugin:0.5"
classpath 'com.github.townsfolk:gradle-release:1.2'
classpath "be.insaneprogramming.gradle:animalsniffer-gradle-plugin:1.4.0"
}
6 changes: 1 addition & 5 deletions gradle/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ if (file("$project.rootDir/.git").exists()) {
}
}

if (project.ext.bintray.signFiles) {
createReleaseTag.dependsOn bintrayUpload, bintraySign
} else {
createReleaseTag.dependsOn bintrayUpload
}
createReleaseTag.dependsOn bintrayUpload
release.doLast {
logger.warn "RELEASED $project.group:$project.name:$project.version"
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Fri Sep 19 01:20:41 NOVT 2014
#Tue Oct 07 00:12:40 NOVT 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit e101e79

Please sign in to comment.