From 8b8f298b818607f06385c1415073131cb16e7566 Mon Sep 17 00:00:00 2001 From: florent champigny Date: Wed, 15 Feb 2017 11:50:18 +0100 Subject: [PATCH] Added circle ci --- .../camerafragment/sample/MainActivity.java | 2 +- camerafragment/build.gradle | 10 ++++----- circle.yml | 5 +++++ gradle/bintray-android-v1.gradle | 21 ++++++++++++++----- gradle/bintray-java-v1.gradle | 21 ++++++++++++++----- 5 files changed, 42 insertions(+), 17 deletions(-) create mode 100644 circle.yml diff --git a/app/src/main/java/com/github/florent37/camerafragment/sample/MainActivity.java b/app/src/main/java/com/github/florent37/camerafragment/sample/MainActivity.java index 63af546..83de9c4 100644 --- a/app/src/main/java/com/github/florent37/camerafragment/sample/MainActivity.java +++ b/app/src/main/java/com/github/florent37/camerafragment/sample/MainActivity.java @@ -156,7 +156,7 @@ public class MainActivity extends AppCompatActivity { cameraLayout.setVisibility(View.VISIBLE); final CameraFragment cameraFragment = CameraFragment.newInstance(new Configuration.Builder() - .setCamera(Configuration.CAMERA_FACE_FRONT).build()); + .setCamera(Configuration.CAMERA_FACE_REAR).build()); getSupportFragmentManager().beginTransaction() .replace(R.id.content, cameraFragment, FRAGMENT_TAG) .commit(); diff --git a/camerafragment/build.gradle b/camerafragment/build.gradle index 7ce901d..65e74c0 100644 --- a/camerafragment/build.gradle +++ b/camerafragment/build.gradle @@ -14,8 +14,8 @@ android { } dependencies { - compile "com.android.support:support-v4:"+ project.supportVersion - compile "com.android.support:appcompat-v7:"+ project.supportVersion + compile "com.android.support:support-v4:" + project.supportVersion + compile "com.android.support:appcompat-v7:" + project.supportVersion } task wrapper(type: Wrapper) { @@ -48,7 +48,5 @@ ext { allLicenses = ["Apache-2.0"] } -if (project.rootProject.file('local.properties').exists()) { - apply from: rootProject.file('gradle/install-v1.gradle') - apply from: rootProject.file('gradle/bintray-android-v1.gradle') -} \ No newline at end of file +apply from: rootProject.file('gradle/install-v1.gradle') +apply from: rootProject.file('gradle/bintray-android-v1.gradle') \ No newline at end of file diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..ceefb2d --- /dev/null +++ b/circle.yml @@ -0,0 +1,5 @@ +deployment: + release: + tag: /v.*/ + commands: + - ./gradlew :camerafragment:bintrayUpload \ No newline at end of file diff --git a/gradle/bintray-android-v1.gradle b/gradle/bintray-android-v1.gradle index 0101dd5..cc7e844 100644 --- a/gradle/bintray-android-v1.gradle +++ b/gradle/bintray-android-v1.gradle @@ -21,13 +21,24 @@ artifacts { archives sourcesJar } +def _user = System.getenv("BINTRAY_USER") +def _key = System.getenv("BINTRAY_API_KEY") +def _passphrase = System.getenv("BINTRAY_PASSPHRASE") + +if(project.rootProject.file('local.properties').exists() && (_user == null || _user.isEmpty())){ + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + + _user = properties.getProperty("bintray.user") + _key = properties.getProperty("bintray.apikey"); + _passphrase = properties.getProperty("bintray.gpg.password") +} + // Bintray -Properties properties = new Properties() -properties.load(project.rootProject.file('local.properties').newDataInputStream()) bintray { - user = properties.getProperty("bintray.user") - key = properties.getProperty("bintray.apikey") + user = _user + key = _key configurations = ['archives'] pkg { @@ -44,7 +55,7 @@ bintray { desc = libraryDescription gpg { sign = true //Determines whether to GPG sign the files. The default is false - passphrase = properties.getProperty("bintray.gpg.password") + passphrase = _passphrase //Optional. The passphrase for GPG signing' } } diff --git a/gradle/bintray-java-v1.gradle b/gradle/bintray-java-v1.gradle index 67025d7..503712b 100644 --- a/gradle/bintray-java-v1.gradle +++ b/gradle/bintray-java-v1.gradle @@ -17,12 +17,23 @@ artifacts { } // Bintray -Properties properties = new Properties() -properties.load(project.rootProject.file('local.properties').newDataInputStream()) + +def _user = System.getenv("BINTRAY_USER") +def _key = System.getenv("BINTRAY_API_KEY") +def _passphrase = System.getenv("BINTRAY_PASSPHRASE") + +if(project.rootProject.file('local.properties').exists() && (_user == null || _user.isEmpty())){ + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + + _user = properties.getProperty("bintray.user") + _key = properties.getProperty("bintray.apikey"); + _passphrase = properties.getProperty("bintray.gpg.password") +} bintray { - user = properties.getProperty("bintray.user") - key = properties.getProperty("bintray.apikey") + user = _user + key = _key configurations = ['archives'] pkg { @@ -39,7 +50,7 @@ bintray { desc = libraryDescription gpg { sign = true //Determines whether to GPG sign the files. The default is false - passphrase = properties.getProperty("bintray.gpg.password") + passphrase = _passphrase //Optional. The passphrase for GPG signing' } }