diff --git a/build.gradle b/build.gradle index e0b366a..886383c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +ext { + VERSION_NAME = '1.0.5' +} buildscript { repositories { @@ -6,6 +9,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:1.5.0' + classpath 'com.novoda:bintray-release:0.3.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -21,3 +25,100 @@ allprojects { task clean(type: Delete) { delete rootProject.buildDir } + +subprojects { + buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.0' + classpath 'com.novoda:bintray-release:0.3.4' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } + } + ext { + //VERSION_NAME = 'maventest' + + MODULE_NAME = project.name + ARTIFACT_ID = project.name + DESCRIPTION = ' ' + SITE_URL = 'https://github.com/tschaumburg/FastBarcodeScanner' + GIT_URL = 'https://github.com/tschaumburg/FastBarcodeScanner.git' + + GROUP_NAME = 'dk.schaumburgit.fast-barcode-scanner' + LICENSE = 'The Apache Software License, Version 2.0' + DEVELOPER_ID = 'tschaumburg' + DEVELOPER_NAME = 'Thomas Schaumburg' + DEVELOPER_EMAIL = 'thomas@schaumburg-it.dk' + + IS_UPLOADING = project.getGradle().startParameter.taskNames.any{it.contains('bintrayUpload')} + } + + if (project.name in ['fast-barcode-scanner-demo']) { + apply plugin: 'com.android.application' + } else { + apply plugin: 'com.android.library' + apply plugin: 'com.novoda.bintray-release' // must be applied after your artifact generating plugin (eg. java / com.android.library) + + publish { + userOrg = 'tschaumburg' + groupId = GROUP_NAME + artifactId = ARTIFACT_ID + uploadName = 'fast-barcode-scanner' + publishVersion = VERSION_NAME + desc = DESCRIPTION + website = SITE_URL + } + } + + if (IS_UPLOADING && !(project.name in ['fast-barcode-scanner-demo'])) { + println project.name + apply plugin: 'maven' + + gradle.taskGraph.whenReady { taskGraph -> + taskGraph.getAllTasks().find { + it.path == ":$project.name:generatePomFileForMavenPublication" + }.doLast { + file("build/publications/maven/pom-default.xml").delete() + println 'Overriding pom-file to make sure we can sync to maven central!' + pom { + //noinspection GroovyAssignabilityCheck + project { + name "$project.name" + groupId GROUP_NAME + artifactId ARTIFACT_ID + packaging project.name == 'compiler' ? 'jar' : 'aar' + description DESCRIPTION + url SITE_URL + version VERSION_NAME + + scm { + url GIT_URL + connection GIT_URL + developerConnection GIT_URL + } + + licenses { + license { + name LICENSE + } + } + + developers { + developer { + id DEVELOPER_ID + name DEVELOPER_NAME + email DEVELOPER_EMAIL + } + } + } + }.writeTo("build/publications/maven/pom-default.xml") + } + } + } + +} +//} \ No newline at end of file diff --git a/fast-barcode-scanner-demo/build.gradle b/fast-barcode-scanner-demo/build.gradle index 8a21139..a05fe39 100644 --- a/fast-barcode-scanner-demo/build.gradle +++ b/fast-barcode-scanner-demo/build.gradle @@ -1,9 +1,5 @@ -apply plugin: 'com.android.application' - ext { - PUBLISH_GROUP_ID = 'dk.schaumburgit.fast-barcode-scanner' - PUBLISH_ARTIFACT_ID = 'fast-barcode-scanner-demo' - PUBLISH_VERSION = '1.0.4' + DESCRIPTION = 'A' } android { @@ -36,4 +32,4 @@ dependencies { compile project(':fast-barcode-scanner') } -apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle' +//apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle' diff --git a/fast-barcode-scanner/build.gradle b/fast-barcode-scanner/build.gradle index 15d0e10..3cbcfc2 100644 --- a/fast-barcode-scanner/build.gradle +++ b/fast-barcode-scanner/build.gradle @@ -1,9 +1,5 @@ -apply plugin: 'com.android.library' - ext { - PUBLISH_GROUP_ID = 'dk.schaumburgit.fast-barcode-scanner' - PUBLISH_ARTIFACT_ID = 'fast-barcode-scanner' - PUBLISH_VERSION = '1.0.4' + DESCRIPTION = 'Fast barcode scanning library for Android apps.' } android { @@ -33,4 +29,4 @@ dependencies { compile project(':tracking-barcode-scanner') } -apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle' +//apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle' diff --git a/fast-barcode-scanner/src/main/java/dk/schaumburgit/fastbarcodescanner/FastBarcodeScanner.java b/fast-barcode-scanner/src/main/java/dk/schaumburgit/fastbarcodescanner/FastBarcodeScanner.java index d899a77..5383ab7 100644 --- a/fast-barcode-scanner/src/main/java/dk/schaumburgit/fastbarcodescanner/FastBarcodeScanner.java +++ b/fast-barcode-scanner/src/main/java/dk/schaumburgit/fastbarcodescanner/FastBarcodeScanner.java @@ -81,17 +81,17 @@ public class FastBarcodeScanner { /** * Creates a headless FastBarcodeScanner (i.e. one without any UI) - *
+ * * FastBarcodeScanner instances created using this constructor will use * the new, efficient Camera2 API for controlling the camera. - * + * * This boosts performance by a factor 5x - but it only works on Android * Lollipop (API version 21) and later. - * + * * As an alternative, consider using the #FastBarcodeScanner constructor * which will create a FastBarcodeScanner working on older versions of * Android too - albeit much less efficiently. - * + * * The following properties control the behaviour of the barcode scanning * (see #TrackingBarcodeScanner for details): UseTracking, RelativeTrackingMargin, * NoHitsBeforeTrackingLoss. @@ -107,13 +107,13 @@ public FastBarcodeScanner(Activity activity, int resolution) { /** * Creates a FastBarcodeScanner using the given TextureView for preview. - * + * * FastBarcodeScanner instances created using this constructor will use * the new, much more efficient Camera2 API for controlling the camera. - * + * * This boosts performance by a factor 5x - but it only works on Android * Lollipop (API version 21) and later. - * + * * As an alternative, consider using the #FastBarcodeScanner constructor * which will create a FastBarcodeScanner working on older versions of * Android too - albeit much less efficiently. @@ -160,7 +160,7 @@ private static int calculateCheapestFormat(Map* The onBarcodeAvailable is called when a new barcode is detected - that is, * if the same barcode is detected in 20 consecutive frames, onBarcodeAvailable diff --git a/settings.gradle b/settings.gradle index 3b07cdc..2a7e84f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':still-sequence-camera', ':tracking-barcode-scanner', ':fast-barcode-scanner', ':fast-barcode-scanner-demo' +include ':tracking-barcode-scanner', ':still-sequence-camera', ':fast-barcode-scanner', ':fast-barcode-scanner-demo' diff --git a/still-sequence-camera/build.gradle b/still-sequence-camera/build.gradle index ec063ee..19b3a85 100644 --- a/still-sequence-camera/build.gradle +++ b/still-sequence-camera/build.gradle @@ -1,9 +1,5 @@ -apply plugin: 'com.android.library' - ext { - PUBLISH_GROUP_ID = 'dk.schaumburgit.fast-barcode-scanner' - PUBLISH_ARTIFACT_ID = 'still-sequence-camera' - PUBLISH_VERSION = '1.0.4' + DESCRIPTION = 'A library allowing apps to take fast sequences of still images without any UI preview' } android { @@ -24,9 +20,10 @@ android { } } + dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' } -apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle' +//apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle' diff --git a/still-sequence-camera/src/main/java/dk/schaumburgit/stillsequencecamera/camera/StillSequenceCamera.java b/still-sequence-camera/src/main/java/dk/schaumburgit/stillsequencecamera/camera/StillSequenceCamera.java index 7f4a2bc..b47e03a 100644 --- a/still-sequence-camera/src/main/java/dk/schaumburgit/stillsequencecamera/camera/StillSequenceCamera.java +++ b/still-sequence-camera/src/main/java/dk/schaumburgit/stillsequencecamera/camera/StillSequenceCamera.java @@ -129,9 +129,9 @@ private static double getFormatCost(int format) { /** * Selects a back-facing camera, opens it and starts focusing. - *
+ * * The #start() method can be called immediately when this method returns - * + * * If setup() returns successfully, the StillSequenceCamera enters the INITIALIZED state. * * @throws IllegalStateException if the StillSequenceCamera is in any but the CLOSED state @@ -180,9 +180,9 @@ public void setup(int format) /** * Starts the preview (displaying it in the #SurfaceView provided in the constructor), * and starts taking pictures as rapidly as possible. - * + * * This continues until #stop() is called. - * + * * If start() returns successfully, the StillSequenceCamera enters the CAPTURING state. * * @param listener Every time a picture is taken, this callback interface is called. @@ -260,7 +260,7 @@ public void surfaceDestroyed(SurfaceHolder holder) { /** * Stops the preview, and stops the capture of still images. - * + * * If stop() returns successfully, the StillSequenceCamera enters the STOPPED state. * * @throws IllegalStateException if stop is called in any but the STARTED state diff --git a/still-sequence-camera/src/main/java/dk/schaumburgit/stillsequencecamera/camera2/FocusManager.java b/still-sequence-camera/src/main/java/dk/schaumburgit/stillsequencecamera/camera2/FocusManager.java index db365ca..7afa26d 100644 --- a/still-sequence-camera/src/main/java/dk/schaumburgit/stillsequencecamera/camera2/FocusManager.java +++ b/still-sequence-camera/src/main/java/dk/schaumburgit/stillsequencecamera/camera2/FocusManager.java @@ -55,7 +55,7 @@ public FocusManager(Activity activity, TextureView textureView) /** * Sets up member variables related to the on-screen preview (if any). - * @param cameraId + * @param cameraId Id of the camera */ public void setup(String cameraId) { try { @@ -284,11 +284,12 @@ public static interface FocusListener /** * - * @param cameraCaptureSession + * @param cameraCaptureSession Session * @param callbackHandler the handler on which the listener should be invoked, or * {@code null} to use the current thread's {@link android.os.Looper * looper}. - * @param listener + * @param listener Listener receiving callbacks + * @param lockFocus l */ public void start(CameraCaptureSession cameraCaptureSession, boolean lockFocus, Handler callbackHandler, FocusListener listener) { diff --git a/tracking-barcode-scanner/build.gradle b/tracking-barcode-scanner/build.gradle index 8f29fd4..fdeba73 100644 --- a/tracking-barcode-scanner/build.gradle +++ b/tracking-barcode-scanner/build.gradle @@ -1,9 +1,5 @@ -apply plugin: 'com.android.library' - ext { - PUBLISH_GROUP_ID = 'dk.schaumburgit.fast-barcode-scanner' - PUBLISH_ARTIFACT_ID = 'tracking-barcode-scanner' - PUBLISH_VERSION = '1.0.4' + DESCRIPTION = 'A wrapper around the ZXing core library, optimized for use with video-like image sequences' } android { @@ -29,5 +25,3 @@ dependencies { testCompile 'junit:junit:4.12' compile 'com.google.zxing:core:3.2.1' } - -apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'