Skip to content

Commit

Permalink
Various maintainance fixes (#13)
Browse files Browse the repository at this point in the history
* Various maintainance fixes

* Add build

* Update build
  • Loading branch information
skjolber authored Apr 7, 2024
1 parent 889a2f7 commit 0136c5a
Show file tree
Hide file tree
Showing 27 changed files with 418 additions and 939 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Android CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Overview
This site hosts a library for [Near Field Communication](http://en.wikipedia.org/wiki/Near_field_communication) on [Android](http://www.android.com/) using the [NDEF](http://developer.android.com/reference/android/nfc/tech/Ndef.html) format.

The current (version <= 10.0) Android SDK only comes with a low-level NDEF API which does not expose developers to the full potential of the NDEF format. Rather than sweating over byte arrays, developers should have access to high-level representations.
The current (version <= 14.0) Android SDK only comes with a low-level NDEF API which does not expose developers to the full potential of the NDEF format. Rather than sweating over byte arrays, developers should have access to high-level representations.

Features:
* NDEF object representation library (no more byte arrays!)
Expand All @@ -20,7 +20,7 @@ The project is built with [Gradle] and is available on the central Maven reposit

```groovy
ext {
ndefToolsForAndroidVersion = '2.0.0'
ndefToolsForAndroidVersion = '2.0.1'
}
```

Expand Down Expand Up @@ -92,13 +92,14 @@ For a graphical NDEF editor, try [NFC Eclipse plugin](https://github.com/skjolbe
This project springs out the [NFC Tools for Java](https://github.com/grundid/nfctools) and [NFC Eclipse plugin](https://github.com/skjolber/nfc-eclipse-plugin) projects.

# History
April 2024: Version 2.0.1 maintainance release.
August 2020: Version 2.0.0 maintainance release:
* Maven coordinates updated; group is now `com.github.skjolber.ndef-tools-for-android`
* Packages renamed to `com.github.skjolber.ndef`
* Added Gradle build (now dual builds with Maven)
* Moved utilities and examples to [seperate project](https://github.com/skjolber/android-nfc-lifecycle-wrapper)
* Minor improvements
~~~~
March 28th 2013: Version 1.2.3 released.<br>
February 5th 2013: Version 1.2.2 released.<br>
January 1st 2013: Version 1.2.1 released.<br>
Expand Down
154 changes: 151 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,158 @@
allprojects {
repositories {
buildscript {
ext.repos = {
mavenLocal()
mavenCentral()
google()
jcenter()
}

repositories repos
}

plugins {
id 'org.owasp.dependencycheck' version '6.5.3' apply false
id 'com.github.ben-manes.versions' version '0.42.0' apply false
id('io.github.gradle-nexus.publish-plugin') version '1.1.0'
}

ext {
junitJupiterVersion = '5.10.2'
}

task clean(type: Delete) {
delete rootProject.buildDir
}

def javaLibraryProjects() {
subprojects.findAll { new File(it.projectDir, 'build.gradle').file }
}

allprojects {
// skip checking test configurations (like lint) or test libraries for vulnerabilities
apply plugin: 'org.owasp.dependencycheck'

buildscript {
repositories repos
}
repositories repos

configurations.all {
// Check for updates every build
// A module with a *-SNAPSHOT version coming from a Maven repository will be considered changing by default.
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}

dependencyCheck {
failOnError = false // let's ignore errors to make builds more stable
analyzedTypes = ['jar'] // the default artifact types that will be analyzed.
// OWASP Dependency Check plugin for Jenkins needs an XML report, but humans may also need an HTML one
format = 'ALL'
// Specifies if the build should be failed if a CVSS score equal to or above a specified level is identified.
failBuildOnCVSS = 7
// specify a list of known issues which contain false-positives
suppressionFiles = ["$rootDir/dependencycheck-root-suppression.xml"]
}
}


configure(javaLibraryProjects()) {
apply plugin: 'java-library'

apply plugin: 'com.github.ben-manes.versions'
}


configure(javaLibraryProjects()) {

apply plugin: 'maven-publish'
apply plugin: 'signing'

repositories repos

java {
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8

withJavadocJar()
withSourcesJar()
}

publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Applies the component for the release build variant.
from components.java

groupId 'com.github.skjolber.ndef-tools-for-android'
artifactId "$project.ext.artifactId"
version "$version"

pom {
name = "$project.ext.artifactName"
description = "$project.ext.artifactDescription"
url = 'https://github.com/skjolber/ndef-tools-for-android'
organization {
name = 'Thomas Rorvik Skjolberg'
url = 'https://github.com/skjolber'
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/skjolber/ndef-tools-for-android/issues'
}
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
scm {
url = 'https://github.com/skjolber/ndef-tools-for-android'
connection = 'scm:[email protected]:skjolber/ndef-tools-for-android.git'
developerConnection = 'scm:[email protected]:skjolber/ndef-tools-for-android.git'
}
developers {
developer {
id = 'skjolber'
name = 'Thomas Rørvik Skjølberg'
}
}
}
}
}
if(project.hasProperty("signing.gnupg.keyName")) {
signing {
useGpgCmd()

// set
// signing.gnupg.keyName=xxx
// signing.gnupg.passphrase=yyy
// via command line or global gradle properties
// then run
// w17 build publishToSonatype --info --stacktrace

sign(publishing.publications)
}
}

}

test {
useJUnitPlatform {
includeEngines 'junit-jupiter', 'junit-vintage'
}
}

dependencies {
// JUnit Jupiter API and TestEngine implementation
testImplementation("org.junit.jupiter:junit-jupiter:${junitJupiterVersion}")
}
}

nexusPublishing {
repositories {
sonatype()
}
}
19 changes: 1 addition & 18 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
org.gradle.jvmargs=-Xmx1024m

VERSION_NAME=2.0.1-SNAPSHOT
version=2.0.1-SNAPSHOT
GROUP=com.github.skjolber.ndef-tools-for-android

POM_PACKAGING=jar

POM_DESCRIPTION=Library for NDEF use in Android
POM_URL=https://github.com/skjolber/ndef-tools-for-android
POM_SCM_URL=https://github.com/skjolber/ndef-tools-for-android
POM_SCM_CONNECTION=scm:[email protected]:skjolber/ndef-tools-for-android.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:skjolber/ndef-tools-for-android.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=skjolber
POM_DEVELOPER_NAME=Thomas Skjolberg

POM_ISSUE_SYSTEM=https://github.com/skjolber/ndef-tools-for-android/issues
POM_ORGANIZATION_NANE=Thomas Rorvik Skjolberg
POM_ORGANIZATION_URL=https://github.com/skjolber
124 changes: 0 additions & 124 deletions gradle/gradle-mvn-push.gradle

This file was deleted.

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,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Loading

0 comments on commit 0136c5a

Please sign in to comment.