Skip to content

Commit

Permalink
Merge pull request #20 from cjstehno/development
Browse files Browse the repository at this point in the history
Version and documentation update.
  • Loading branch information
cjstehno committed Mar 15, 2017
2 parents 31601f0 + a243311 commit 5ffe220
Show file tree
Hide file tree
Showing 22 changed files with 560 additions and 33 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: java
install: true
jdk: oraclejdk8
env:
matrix:
- TERM=dumb
before_script:
- ./gradlew --version
script: ./gradlew build
after_success:
- ./gradlew jacocoTestReport coveralls
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Gradle Natives Plugin

[![Build Status](https://travis-ci.org/cjstehno/gradle-natives.svg?branch=master)](https://travis-ci.org/cjstehno/gradle-natives) [![Coverage Status](https://coveralls.io/repos/github/cjstehno/gradle-natives/badge.svg?branch=master)](https://coveralls.io/github/cjstehno/gradle-natives?branch=master)

A Gradle plugin to aid in working with Java-based projects that provide supporting native libraries.

## Build
Expand All @@ -18,7 +20,7 @@ buildscript {
}
}
dependencies {
classpath "gradle.plugin.com.stehno:gradle-natives:0.3.0"
classpath "gradle.plugin.com.stehno:gradle-natives:0.3.1"
}
}
Expand All @@ -29,7 +31,7 @@ Alternately, you can use the new plug definition block in Gradle 2.1 and beyond.

```groovy
plugins {
id 'com.stehno.natives' version '0.3.0'
id 'com.stehno.natives' version '0.3.1'
}
```

Expand Down
85 changes: 78 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
plugins {
id 'groovy'
id 'com.github.hierynomus.license' version '0.13.1'
id 'com.gradle.plugin-publish' version '0.9.4'
id 'com.gradle.plugin-publish' version '0.9.7'
id 'maven-publish'
id 'java-gradle-plugin'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.8.1'
id "com.stehno.gradle.webpreview" version "0.1.1"
}

group = 'com.stehno'
version = '0.3.0'
version = '0.3.1'

// explicit requests were made to build under Java 7
sourceCompatibility = 7
Expand All @@ -27,18 +30,14 @@ dependencies {
}
}

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

pluginBundle {
website = 'http://cjstehno.github.io/gradle-natives/'
vcsUrl = 'https://github.com/cjstehno/gradle-natives'
description = 'Gradle plugin to aid in handling native libraries associated with Java-based projects.'
tags = ['gradle', 'groovy', 'native']

plugins {
greetingsPlugin {
gradleNativesPlugin {
id = 'com.stehno.natives'
displayName = 'Gradle-Natives Plugin'
}
Expand All @@ -51,3 +50,75 @@ license {
ext.email = 'chris@stehno.com'
ext.year = Calendar.instance.get(Calendar.YEAR)
}

jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}

task site(group: 'Documentation', description: 'Builds the documentation web site.', dependsOn: ['build', 'jacocoTestReport']) {
doLast {
logger.info 'Building documentation web site...'

// copy the templates
copy {
from 'src/site'
into 'build/site'
include '**/*.html'
expand([project_version: project.version, year: Calendar.instance.get(Calendar.YEAR)])
}

// copy the assets
copy {
from 'src/site'
into 'build/site'
include '**/stylesheets/**'
include '**/javascripts/**'
include '**/images/**'
}

copy {
from 'build/reports'
include '**/**'
into 'build/site'
}
}
}

task publishSite(type: GradleBuild, group: 'Publishing', description: 'Publishes the documentation web site.', dependsOn: ['site']) {
buildFile = 'publish.gradle'
tasks = ['publishGhPages']
}

task updateVersion(group: 'Documentation', description: 'Updates the version in documentation based on the project version') {
doLast {
String newVersion = project.version
String oldVersion = project.property('from')

logger.lifecycle "Updating documentation versions from ${oldVersion} to ${newVersion}..."

ant.replace(file: 'README.md', token: oldVersion, value: newVersion)
}
}

task checkVersion(group: 'Verification', description: 'Verify that the project version is reflected in the documentation.') {
doLast {
logger.lifecycle "Verifying that the documentation references version ${project.version}..."

// Not the most efficient way to do this but should be ok for now
boolean documented = ['README.md'].every { f ->
boolean ok = project.file(f).text.contains(project.version)

logger.info " - Checking: $f: $ok"
ok
}

assert documented, 'The documented project version does not match the project version: Run "./gradlew updateVersion -Pfrom=OLD_VERSION" and try again.'
}
}

webPreview {
resourceDir = file('build/site')
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Sep 17 06:59:08 CDT 2016
#Wed Mar 15 09:48:11 CDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
19 changes: 11 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -154,16 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
20 changes: 20 additions & 0 deletions publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'org.ajoberstar:gradle-git:1.0.0'
}
}

apply plugin: 'org.ajoberstar.github-pages'

githubPages {
repoUri = 'git@github.com:cjstehno/gradle-natives'
pages {
from(file('build/site')) {
into '.'
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Christopher J. Stehno <chris@stehno.com>
* Copyright (C) 2017 Christopher J. Stehno <chris@stehno.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Christopher J. Stehno <chris@stehno.com>
* Copyright (C) 2017 Christopher J. Stehno <chris@stehno.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Christopher J. Stehno <chris@stehno.com>
* Copyright (C) 2017 Christopher J. Stehno <chris@stehno.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Christopher J. Stehno <chris@stehno.com>
* Copyright (C) 2017 Christopher J. Stehno <chris@stehno.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Christopher J. Stehno <chris@stehno.com>
* Copyright (C) 2017 Christopher J. Stehno <chris@stehno.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Christopher J. Stehno <chris@stehno.com>
* Copyright (C) 2017 Christopher J. Stehno <chris@stehno.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Christopher J. Stehno <chris@stehno.com>
* Copyright (C) 2017 Christopher J. Stehno <chris@stehno.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2016 Christopher J. Stehno <chris@stehno.com>
# Copyright (C) 2017 Christopher J. Stehno <chris@stehno.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
80 changes: 80 additions & 0 deletions src/site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Gradle Natives Plugin by cjstehno</title>

<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<header>
<h1>Gradle Natives Plugin</h1>
<p>Gradle plugin to aid in managing native libraries associated with Java-based projects.</p>

<p class="view"><a href="https://github.com/cjstehno/gradle-natives">View the Project on GitHub <small>cjstehno/gradle-natives</small></a></p>


<ul>
<li><a href="https://github.com/cjstehno/gradle-natives/zipball/master">Download <strong>ZIP File</strong></a></li>
<li><a href="https://github.com/cjstehno/gradle-natives/tarball/master">Download <strong>TAR Ball</strong></a></li>
<li><a href="https://github.com/cjstehno/gradle-natives">View On <strong>GitHub</strong></a></li>
</ul>
</header>
<section>
<h3>
<a name="welcome-to-github-pages" class="anchor" href="#welcome-to-github-pages"><span class="octicon octicon-link"></span></a>Welcome</h3>

<p>This Gradle plugin fills the native library support gap and provides a simple means of unpacking native libraries provided by your project dependencies into a well-known and usable location. Configuration is simple; just
add the following to your <code>gradle.build</code> file:</p>

<pre><code>
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.stehno:gradle-natives:${project_version}"
}
}

apply plugin: "com.stehno.natives"
</code></pre>

Alternately, you can use the new <code>plugins</code> block with Gradle 2.1 (and later):

<pre><code>
plugins {
id 'com.stehno.natives' version '${project_version}'
}
</code></pre>

<p>See the <a href="https://github.com/cjstehno/gradle-natives">main project page</a> for more documentation, or you can take a look at the two blog
posts I have written about the project:</p>

<ul>
<li><a href="http://coffeaelectronica.com/blog/2016/gradle-natives-update.html">Gradle Natives Plugin Update</a></li>
<li><a href="http://coffeaelectronica.com/blog/2014/going-native-with-gradle.html">Going Native with Gradle</a></li>
</ul>

<h3><a name="support-or-contact" class="anchor" href="#support-or-contact"><span class="octicon octicon-link"></span></a>Support or Contact</h3>

<p>Having issues or an idea for a new feature, let me know, just create an <a href="https://github.com/cjstehno/gradle-natives/issues">issue</a>.</p>
</section>
<footer>
<p>This project is maintained by <a href="https://github.com/cjstehno">cjstehno</a></p>
<p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
</footer>
</div>
<script src="javascripts/scale.fix.js"></script>

</body>
</html>
17 changes: 17 additions & 0 deletions src/site/javascripts/scale.fix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
document.addEventListener("gesturestart", gestureStart, false);
}
function gestureStart() {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
}
}
}

0 comments on commit 5ffe220

Please sign in to comment.