Skip to content
This repository was archived by the owner on Aug 26, 2021. It is now read-only.

Commit 4bb93ae

Browse files
authored
Merge pull request #118 from MathiasGr/2.3.1release
CI-487: publish stag artifacts and doc to MavenCentral
2 parents 4118871 + 31a21bf commit 4bb93ae

10 files changed

Lines changed: 202 additions & 48 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ script:
2020
- rvm install 2.2
2121
- rvm use 2.2
2222
- bundle install
23-
- FASTLANE_SKIP_UPDATE_CHECK=1 bundle exec fastlane test
23+
- FASTLANE_SKIP_UPDATE_CHECK=1 bundle exec fastlane shipit
2424
- ./gradlew jacocoTestReport --stacktrace
2525
after_success:
2626
- bash <(curl -s https://codecov.io/bash)

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Change Log
22
==========
33

4+
Version 2.3.1 *(2017-06-27)*
5+
----------------------------
6+
- Stag is now being deployed to Maven Central.
7+
48
Version 2.3.0 *(2017-06-22)*
59
----------------------------
610
- Stag now throws an exception if you try to reuse a `Stag.Factory` instance between multiple gson instances.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ buildscript {
4949
apply plugin: 'net.ltgt.apt'
5050
5151
dependencies {
52-
compile 'com.vimeo.stag:stag-library:2.3.0'
53-
apt 'com.vimeo.stag:stag-library-compiler:2.3.0'
52+
compile 'com.vimeo.stag:stag-library:2.3.1'
53+
apt 'com.vimeo.stag:stag-library-compiler:2.3.1'
5454
}
5555
5656
// Optional annotation processor arguments (see below)
@@ -67,8 +67,8 @@ apt {
6767

6868
```groovy
6969
dependencies {
70-
compile 'com.vimeo.stag:stag-library:2.3.0'
71-
annotationProcessor 'com.vimeo.stag:stag-library-compiler:2.3.0'
70+
compile 'com.vimeo.stag:stag-library:2.3.1'
71+
annotationProcessor 'com.vimeo.stag:stag-library-compiler:2.3.1'
7272
}
7373
7474
android {

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ buildscript {
1515
}
1616
dependencies {
1717
classpath 'com.android.tools.build:gradle:2.3.3'
18-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
18+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
1919
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.1'
2020
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2121
}
@@ -38,5 +38,5 @@ allprojects {
3838

3939
subprojects {
4040
group = 'com.vimeo.stag'
41-
version = '2.3.0'
41+
version = '2.3.1'
4242
}

fastlane/Fastfile

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,42 @@ platform :android do
2828
end
2929
end
3030

31+
desc "main entrypoint for CI"
32+
lane :shipit do
33+
if is_ci
34+
# If the build was triggered by a Pull Request
35+
if ENV['TRAVIS_PULL_REQUEST'] && ENV['TRAVIS_PULL_REQUEST'] != 'false'
36+
test
37+
else
38+
# This build was triggered by a branch update
39+
branch = git_branch
40+
# If the branch is master, this means new updates were merged into master
41+
# Then publish the artifacts to bintray
42+
if branch == 'master'
43+
publish_artifacts(
44+
snapshot: false
45+
)
46+
47+
# TODO: publish Snapshots with snapshot = true
48+
end
49+
end
50+
end
51+
end
52+
53+
desc "publish artifacts to bintray. Use the 'snapshot' option (boolean) to publish a Snapshot instead of a release (not implemented yet)"
54+
lane :publish_artifacts do |options|
55+
# Upload to bintray
56+
gradle(
57+
task: "stag-library:bintrayUpload stag-library-compiler:bintrayUpload",
58+
properties: {
59+
"snapshot" => options[:snapshot]
60+
}
61+
)
62+
end
63+
3164
desc "test"
3265
lane :test do
3366

34-
# gotta do some setup before running gradle
35-
sh 'touch ../local.properties'
36-
3767
# run the tests, but dont puke everywhere until the report is printed.
3868
junit_report_path_array = [
3969
"stag-library/build/test-results/test/*.xml",

fastlane/README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,45 @@
11
fastlane documentation
22
================
33
# Installation
4+
5+
Make sure you have the latest version of the Xcode command line tools installed:
6+
47
```
5-
sudo gem install fastlane
8+
xcode-select --install
69
```
10+
11+
## Choose your installation method:
12+
13+
<table width="100%" >
14+
<tr>
15+
<th width="33%"><a href="http://brew.sh">Homebrew</a></td>
16+
<th width="33%">Installer Script</td>
17+
<th width="33%">Rubygems</td>
18+
</tr>
19+
<tr>
20+
<td width="33%" align="center">macOS</td>
21+
<td width="33%" align="center">macOS</td>
22+
<td width="33%" align="center">macOS or Linux with Ruby 2.0.0 or above</td>
23+
</tr>
24+
<tr>
25+
<td width="33%"><code>brew cask install fastlane</code></td>
26+
<td width="33%"><a href="https://download.fastlane.tools">Download the zip file</a>. Then double click on the <code>install</code> script (or run it in a terminal window).</td>
27+
<td width="33%"><code>sudo gem install fastlane -NV</code></td>
28+
</tr>
29+
</table>
30+
731
# Available Actions
832
## Android
33+
### android shipit
34+
```
35+
fastlane android shipit
36+
```
37+
main entrypoint for CI
38+
### android publish_artifacts
39+
```
40+
fastlane android publish_artifacts
41+
```
42+
publish artifacts to bintray. Use the 'snapshot' option (boolean) to publish a Snapshot instead of a release (not implemented yet)
943
### android test
1044
```
1145
fastlane android test
@@ -15,5 +49,5 @@ test
1549
----
1650

1751
This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
18-
More information about fastlane can be found on [https://fastlane.tools](https://fastlane.tools).
19-
The documentation of fastlane can be found on [GitHub](https://github.com/fastlane/fastlane/tree/master/fastlane).
52+
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
53+
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

stag-library-compiler/build.gradle

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ task sourcesJar(type: Jar, dependsOn: classes) {
4747
from sourceSets.main.allSource
4848
}
4949

50+
tasks.withType(Javadoc).all { enabled = true }
51+
5052
task javadocJar(type: Jar, dependsOn: javadoc) {
5153
classifier = 'javadoc'
5254
from javadoc.destinationDir
@@ -56,35 +58,67 @@ artifacts {
5658
archives sourcesJar, javadocJar
5759
}
5860

61+
// Create the pom configuration
62+
// All the fields below are required by Maven Central
63+
def pomConfig = {
64+
licenses {
65+
license {
66+
name "MIT License"
67+
url "http://www.opensource.org/licenses/mit-license.php"
68+
distribution "repo"
69+
}
70+
}
71+
developers {
72+
developer {
73+
id "vimeo"
74+
name "Vimeo Mobile"
75+
email "mobileops@vimeo.com"
76+
organisation "Vimeo"
77+
organisationUrl "https://github.com/vimeo"
78+
}
79+
}
80+
81+
scm {
82+
connection "scm:git:git://github.com/vimeo/stag-java.git"
83+
developerConnection "scm:git:ssh://github.com:vimeo/stag-java.git"
84+
url "https://github.com/vimeo/stag-java"
85+
}
86+
}
87+
88+
// Create the publication with the pom configuration:
5989
// Requires apply plugin: maven-publish
6090
publishing {
6191
publications {
62-
mavenJava(MavenPublication) {
63-
// We don't have any complex artifacts, so let's just
64-
// reference the fact that we rely on plugin java
92+
MyPublication(MavenPublication) {
6593
from components.java
94+
artifact sourcesJar
95+
artifact javadocJar
6696
groupId project.group
6797
artifactId 'stag-library-compiler'
6898
version project.version
69-
70-
artifact sourcesJar
71-
artifact javadocJar
99+
pom.withXml {
100+
def root = asNode()
101+
root.appendNode('description', 'Stag improves Gson performance by automatically generating reflection-less TypeAdapters for your model objects.')
102+
root.appendNode('name', 'stag-library-compiler')
103+
root.appendNode('url', 'https://github.com/vimeo/stag-java')
104+
root.children().last() + pomConfig
105+
}
72106
}
73107
}
74108
}
75109

76-
// Only execute the bintray task if this is the actual stag-library-compilers project (not an include)
110+
// Only execute the bintray task if this is the actual networking project (not an include)
77111
allprojects {
78112
afterEvaluate { project ->
79113
def bintrayProject = project.plugins.hasPlugin('com.jfrog.bintray')
80114
if (bintrayProject) {
81115
bintray {
82-
Properties properties = new Properties()
83-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
84-
user = properties.getProperty('bintray.user')
85-
key = properties.getProperty('bintray.apikey')
86-
publications = ['mavenJava']
116+
user = System.getenv('BINTRAY_USER')
117+
// api key
118+
key = System.getenv('BINTRAY_API_KEY')
119+
publications = ['MyPublication']
87120
dryRun = false // Whether to run this as dry-run, without deploying
121+
override = false
88122
pkg {
89123
repo = 'maven'
90124
name = 'stag-library-compiler'
@@ -98,9 +132,19 @@ allprojects {
98132
version {
99133
name = project.version
100134
vcsTag = project.version
135+
gpg {
136+
sign = true
137+
passphrase = System.getenv('BINTRAY_GPG_PASSWORD')
138+
}
139+
mavenCentralSync {
140+
sync = true //Optional (true by default). Determines whether to sync the version to Maven Central.
141+
user = System.getenv('SONATYPE_TOKEN_USER') //OSS user token
142+
password = System.getenv('SONATYPE_TOKEN_PASSWORD') //OSS user password
143+
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.
144+
}
101145
}
102146
}
103147
}
104148
}
105149
}
106-
}
150+
}

stag-library-compiler/src/main/java/com/vimeo/stag/processor/utils/TypeUtils.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,22 +301,20 @@ public static boolean isEnum(@Nullable TypeElement element) {
301301
* Retrieves a Map of the inherited concrete member variables of an Element. This takes all the
302302
* member variables that were inherited from the generic parent class and evaluates what their concrete
303303
* type will be based on the concrete inherited type. For instance, take the following code example:
304-
* <pre>
305-
* {@code
306-
* Factory<T> {
304+
* <pre><code>
305+
* {@literal Factory<T>} {
307306
*
308-
* @literal @UseStag
307+
* {@literal @UseStag}
309308
* public T data;
310309
*
311310
* }
312311
*
313-
* VideoFactory extends Factory<Video> {
312+
* VideoFactory extends {@literal Factory<Video>}{
314313
*
315314
* // other variables in here
316315
*
317316
* }
318-
* }
319-
* </pre>
317+
* </code></pre>
320318
* In this example, VideoFactory has a public member variable T that is of type Video.
321319
* Since the Factory class has the UseStag annotation, we cannot just generate
322320
* parsing code for the Factory class, since it is generic and we need concrete types.

0 commit comments

Comments
 (0)