Skip to content

Commit

Permalink
Merge pull request #224 from MathiasGr/go1.1.1
Browse files Browse the repository at this point in the history
CI-481 | Uploading to Maven Central + Fixing Docs
  • Loading branch information
MathiasGr authored Jun 27, 2017
2 parents abbac4e + adc5d0a commit 6a3a73b
Show file tree
Hide file tree
Showing 50 changed files with 157 additions and 122 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
}
}

Expand Down
36 changes: 16 additions & 20 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,27 @@ platform :android do
# If the branch is master, this means new updates were merged into master
# Then publish the artifacts to bintray
if branch == 'master'
publish_artifacts
publish_artifacts(
snapshot: false
)

# TODO: publish Snapshots with snapshot = true
end
end
end
end

desc "publish artifacts to bintray"
lane :publish_artifacts do
if ENV['SONATYPE_TOKEN_USER'] && ENV['SONATYPE_TOKEN_PASSWORD']
# Upload to bintray
gradle(
task: "vimeo-networking:bintrayUpload"
)

# Sync version files to a oss.sonatype.org staging repository to publish these files to Maven Central.
# https://bintray.com/docs/api/#_sync_version_artifacts_to_maven_central
sh "curl -X POST -d '{\"username\": \"#{ENV['SONATYPE_TOKEN_USER']}\", \"password\": \"#{ENV['SONATYPE_TOKEN_PASSWORD']}\"}' https://api.bintray.com/maven_central_sync/vimeo/maven/vimeo-networking/versions/#{get_version}"
else
UI.user_error!("Failed to publish artifacts to bintray since the SONATYPE_TOKEN_USER and SONATYPE_TOKEN_PASSWORD are not set.")
end
desc "publish artifacts to bintray. Use the 'snapshot' option (boolean) to publish a Snapshot instead of a release (not implemented yet)"
lane :publish_artifacts do |options|
# Upload to bintray
gradle(
task: "vimeo-networking:bintrayUpload",
properties: {
"snapshot" => options[:snapshot]
}
)
end

desc "test"
lane :test do

Expand Down Expand Up @@ -89,10 +88,7 @@ platform :android do
gradle(
task: "vimeo-networking:assemble"
)
gradle(
task: "example:packageRelease"
)


pretty_junit(file_pattern: "vimeo-networking/build/test-results/TEST-*")

end
Expand Down
4 changes: 2 additions & 2 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ xcode-select --install

# Available Actions
## Android
### android entrypoint
### android shipit
```
fastlane android entrypoint
fastlane android shipit
```
main entrypoint for CI
### android publish_artifacts
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

org.gradle.parallel=true
org.gradle.daemon=true
version='1.1.0'
version=1.1.1
65 changes: 52 additions & 13 deletions vimeo-networking/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ repositories {
jcenter()
}

tasks.withType(Javadoc).all { enabled = true }

dependencies {
testCompile 'junit:junit:4.12'
compile fileTree(dir: 'libs', include: ['*.jar'])
Expand Down Expand Up @@ -50,19 +52,51 @@ artifacts {
archives sourcesJar, javadocJar
}

// Create the pom configuration
// All the fields below are required by Maven Central
def pomConfig = {
licenses {
license {
name "MIT License"
url "http://www.opensource.org/licenses/mit-license.php"
distribution "repo"
}
}
developers {
developer {
id "vimeo"
name "Vimeo Mobile"
email "[email protected]"
organisation "Vimeo"
organisationUrl "https://github.com/vimeo"
}
}

scm {
connection "scm:git:git://github.com/vimeo/vimeo-networking-java.git"
developerConnection "scm:git:ssh://github.com:vimeo/vimeo-networking-java.git"
url "https://github.com/vimeo/vimeo-networking-java"
}
}

// Create the publication with the pom configuration:
// Requires apply plugin: maven-publish
publishing {
publications {
mavenJava(MavenPublication) {
// We dont have any complex artifacts, so let's just reference the fact that we
// rely on plugin java
MyPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId 'vimeo-networking'
version project.version

artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('description', 'vimeo-networking is a Java networking library used for interacting with the Vimeo API.')
root.appendNode('name', 'vimeo-networking')
root.appendNode('url', 'https://github.com/vimeo/vimeo-networking-java')
root.children().last() + pomConfig
}
}
}
}
Expand All @@ -73,17 +107,12 @@ allprojects {
def bintrayProject = project.plugins.hasPlugin('com.jfrog.bintray')
if (bintrayProject) {
bintray {
// CI Publish - next 2 lines
user = System.getenv('BINTRAY_USER')
// api key
key = System.getenv('BINTRAY_API_KEY')
// Local publish - uncomment the next 4 lines
// Properties properties = new Properties()
// properties.load(project.rootProject.file('local.properties').newDataInputStream())
// user = properties.getProperty('bintray.user')
// key = properties.getProperty('bintray.apikey')
publications = ['mavenJava']
publications = ['MyPublication']
dryRun = false // Whether to run this as dry-run, without deploying
override = false
pkg {
repo = 'maven'
name = 'vimeo-networking'
Expand All @@ -97,6 +126,16 @@ allprojects {
version {
name = project.version
vcsTag = project.version
gpg {
sign = true
passphrase = System.getenv('BINTRAY_GPG_PASSWORD')
}
mavenCentralSync {
sync = true //Optional (true by default). Determines whether to sync the version to Maven Central.
user = System.getenv('SONATYPE_TOKEN_USER') //OSS user token
password = System.getenv('SONATYPE_TOKEN_PASSWORD') //OSS user password
close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/**
* Interface responsible for handling the creation, deletion, and loading of Vimeo accounts on the client.
* <p/>
* <p>
* Created by hanssena on 4/27/15.
*/
public interface AccountStore {
Expand All @@ -35,7 +35,7 @@ public interface AccountStore {

/**
* @deprecated use {@link #saveAccount(VimeoAccount, String)} instead
* <p/>
* <p>
* We find no use in storing the password when you can persist the {@link VimeoAccount} across
* application sessions.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@

/**
* The configuration object for making API calls with Retrofit.
* <p/>
* <p>
* An instance of this class is used the initialize the {@link VimeoClient}.
* <p/>
* <p>
* Created by alfredhanssen on 4/12/15.
*/
public class Configuration {
Expand Down Expand Up @@ -98,7 +98,7 @@ public Cache getCache() {

/**
* @deprecated use {@link #saveAccount(VimeoAccount, String)} instead
* <p/>
* <p>
* We find no use in storing the password when you can persist the {@link VimeoAccount} across
* application sessions.
*/
Expand Down Expand Up @@ -211,7 +211,7 @@ public static class Builder {
/**
* The most basic builder constructor. If you've only provided an access token, you'll only be able to
* make requests for the given access token's account.
* <p/>
* <p>
* If you'd like the ability to switch accounts or request a client credentials grant, you'll have to set a client id and client secret.
* If you'd like the ability to persist accounts, you'll have to set an account store.
* If you'd like the ability to issue code grant, you'll have to set a code grant redirect uri.
Expand Down Expand Up @@ -245,7 +245,7 @@ public Builder(String clientId, String clientSecret, String scope,
* @param clientId The client id provided to you from <a href="https://developer.vimeo.com/apps/">the developer console</a>
* @param clientSecret The client secret provided to you from <a href="https://developer.vimeo.com/apps/">the developer console</a>
* @param scope Space separated list of <a href="https://developer.vimeo.com/api/authentication#scopes">scopes</a>
* <p/>
* <p>
* Example: "private public create"
* @param accountStore (Optional, Recommended) An implementation that can be used to interface with Androids <a href="http://developer.android.com/reference/android/accounts/AccountManager.html">Account Manager</a>
* @param deserializer (Optional, Recommended) Extend GsonDeserializer to allow for deserialization on a background thread
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@
* require a class to be declared up front). Since this is a Java library and we don't have access to
* the UI thread, consumers of this library will need to provide their own implementation of deserialization
* on a background thread and calling their callback on the platform's main/UI thread
* <p/>
* <p>
* For Android, you can achieve this task by extending this class and calling {@link GsonDeserializer#deserializeObject}
* on any background thread and {@link ModelCallback#success(Object)} on their UI thread.
* <p/>
* <p>
* By default, this class will just deserialize objects and callback on the calling thread.
* <p/>
* <p>
* Created by zetterstromk on 7/24/15.
*/
public class GsonDeserializer {

/**
* Deserialize the json and call a callback method.
* <p/>
* <p>
* Override this method to perform custom deserialization. For example,
* on Android, you may want to use a AsyncTask to do this work on
* <p/>
* <p>
*
* @param gson The Gson object do do the lifting
* @param object The Object object deserialize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

/**
* Builder for creating Square OkHttpClient with pinned certificate that can be used with Retrofit.
* </p>
* <p>
* Created by kylevenn on 6/10/15.
*/
public class RetrofitClientBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/**
* Class to handle searching. To use this class, your app must be whitelisted. If you are not an approved app,
* you can still use the existing search mechanism {@link VimeoClient#search(String, String, ModelCallback, Map, String)}.
* <p/>
* <p>
* Created by zetterstromk on 6/27/16.
*/
public final class Search {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/**
* A builder for constructing the parameter map that should be sent along with {@link VimeoClient#search(String, String, ModelCallback, Map, String)}.
* This is used to refine any of your searches. It returns a map so you can add additional parameters to it.
* <p/>
* <p>
* Created by kylevenn on 7/9/15.
*/
public class SearchRefinementBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

/**
* The constants class for Vimeo API calls. This includes parameters, fields, and defaults
* <p/>
* <p>
* Created by kylevenn on 7/7/15.
*/
public class Vimeo {
Expand Down
Loading

0 comments on commit 6a3a73b

Please sign in to comment.