Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit 281eedc

Browse files
committed
publish javadoc
1 parent 202c27c commit 281eedc

File tree

2 files changed

+81
-39
lines changed

2 files changed

+81
-39
lines changed

.travis.yml

Lines changed: 72 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,81 @@
1-
language: java
2-
jdk: oraclejdk8
1+
jobs:
2+
include:
3+
- stage: main
4+
language: java
5+
jdk: oraclejdk8
6+
install: true
7+
before_script:
8+
- export MAJOR_VERSION=`sed -n 's/^ext\.majorVersion = \(.*\)$/\1/p' build.gradle`
9+
- export MINOR_VERSION=`sed -n 's/^ext\.minorVersion = \(.*\)$/\1/p' build.gradle`
10+
- export MC_VERSION=`sed -n 's/^ext\.minecraftVersion = "\(.*\)"$/\1/p' build.gradle`
11+
- export VERSION_STRING=$MAJOR_VERSION.$MINOR_VERSION.$TRAVIS_BUILD_NUMBER-mc$MC_VERSION
12+
- git config --global user.email "[email protected]"
13+
- git config --global user.name "Travis CI"
14+
- 'sed -i "s/^\(version: \).*\$/\1$VERSION_STRING/g" src/main/resources/plugin.yml'
15+
script: gradle build
16+
after_success:
17+
- cp build/libs/NyaaUtils.jar ./NyaaUtils-v$VERSION_STRING.jar
18+
- export GIT_TAG=v$VERSION_STRING
19+
- git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
20+
- export GIT_ORIGIN_URL=`git config --get remote.origin.url`
21+
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi
22+
- if [ "$TRAVIS_BRANCH" != "master" ]; then exit 0; fi
23+
- |
24+
if [ $PUBLISH_MAVEN ]; then
25+
./gradlew publish;
26+
pushd ..;
27+
git clone -b maven-repo $MAVEN_REPO_URL mvn;
28+
cp -r NyaaUtils/build/repo/cat mvn/;
29+
cd mvn;
30+
git config credential.helper "store --file=.git/credentials";
31+
echo "https://$GITHUB_KEY:@github.com" > .git/credentials;
32+
git add .;
33+
git commit -m "auto generated maven repo";
34+
git push --follow-tags;
35+
popd;
36+
fi
37+
deploy:
38+
skip_cleanup: true
39+
provider: releases
40+
prerelease: true
41+
api_key: ${GITHUB_DEPLOY_KEY}
42+
file: ./NyaaUtils-v$VERSION_STRING.jar
43+
on:
44+
tags: false
45+
46+
- stage: javadoc
47+
language: java
48+
jdk: oraclejdk10
49+
script:
50+
- export MAJOR_VERSION=`sed -n 's/^ext\.majorVersion = \(.*\)$/\1/p' build.gradle`
51+
- export MINOR_VERSION=`sed -n 's/^ext\.minorVersion = \(.*\)$/\1/p' build.gradle`
52+
- export MC_VERSION=`sed -n 's/^ext\.minecraftVersion = "\(.*\)"$/\1/p' build.gradle`
53+
- export VERSION_STRING=$MAJOR_VERSION.$MINOR_VERSION-mc$MC_VERSION
54+
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi
55+
- if [ "$TRAVIS_BRANCH" != "master" ]; then exit 0; fi
56+
- |
57+
if [ $PUBLISH_JAVADOC ]; then
58+
./gradlew javadoc;
59+
pushd ..;
60+
git clone -b gh-pages $MAVEN_REPO_URL pages;
61+
rm -rf pages/NyaaUtils/$VERSION_STRING/;
62+
mkdir -p pages/NyaaUtils/$VERSION_STRING/;
63+
cp -r NyaaUtils/build/docs/javadoc pages/NyaaUtils/$VERSION_STRING/;
64+
cd pages;
65+
git config credential.helper "store --file=.git/credentials";
66+
echo "https://$GITHUB_KEY:@github.com" > .git/credentials;
67+
git add .;
68+
git commit -m "auto generated javadoc";
69+
git push --follow-tags;
70+
popd;
71+
fi
72+
373
branches:
474
except:
575
- "/^*-v[0-9]/"
676
- "/^*-mc/"
777
- "maven-repo"
878
- "maven-repo-dev"
9-
install: true
10-
before_script:
11-
- export MAJOR_VERSION=`sed -n 's/^ext\.majorVersion = \(.*\)$/\1/p' build.gradle`
12-
- export MINOR_VERSION=`sed -n 's/^ext\.minorVersion = \(.*\)$/\1/p' build.gradle`
13-
- export MC_VERSION=`sed -n 's/^ext\.minecraftVersion = "\(.*\)"$/\1/p' build.gradle`
14-
- export VERSION_STRING=$MAJOR_VERSION.$MINOR_VERSION.$TRAVIS_BUILD_NUMBER-mc$MC_VERSION
15-
- git config --global user.email "[email protected]"
16-
- git config --global user.name "Travis CI"
17-
- 'sed -i "s/^\(version: \).*\$/\1$VERSION_STRING/g" src/main/resources/plugin.yml'
18-
script: gradle build
19-
after_success:
20-
- cp build/libs/NyaaUtils.jar ./NyaaUtils-v$VERSION_STRING.jar
21-
- export GIT_TAG=v$VERSION_STRING
22-
- git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
23-
- export GIT_ORIGIN_URL=`git config --get remote.origin.url`
24-
- ./gradlew publish
25-
- |
26-
if [ $PUBLISH_MAVEN ]; then
27-
cd ..;
28-
git clone -b maven-repo $MAVEN_REPO_URL mvn;
29-
cp -r NyaaUtils/build/repo/cat mvn/;
30-
cd mvn;
31-
git config credential.helper "store --file=.git/credentials";
32-
echo "https://$GITHUB_KEY:@github.com" > .git/credentials;
33-
git add .;
34-
git commit -m "auto generated maven repo";
35-
git push --follow-tags;
36-
fi
37-
- cd ../NyaaUtils
38-
deploy:
39-
skip_cleanup: true
40-
provider: releases
41-
prerelease: true
42-
api_key: ${GITHUB_DEPLOY_KEY}
43-
file: ./NyaaUtils-v$VERSION_STRING.jar
44-
on:
45-
tags: false
4679
before_cache:
4780
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
4881
- rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.bin

build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,12 @@ publishing {
9797
}
9898
}
9999
}
100+
101+
javadoc {
102+
(options as StandardJavadocDocletOptions).with {
103+
links 'https://docs.oracle.com/javase/8/docs/api/'
104+
links 'https://hub.spigotmc.org/javadocs/bukkit/'
105+
links 'https://google.github.io/guava/releases/21.0/api/docs/'
106+
links 'https://nyaacat.github.io/NyaaCentral/NyaaCore/6.1-mc1.13/javadoc/'
107+
}
108+
}

0 commit comments

Comments
 (0)