Adds in a jenkinsfile
This commit is contained in:
parent
bcaf02091f
commit
7f0bee7c28
3 changed files with 56 additions and 1 deletions
29
Jenkinsfile
vendored
Normal file
29
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
pipeline {
|
||||
agent linux
|
||||
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
dart doc
|
||||
}
|
||||
}
|
||||
steps('Test') {
|
||||
steps {
|
||||
dart test
|
||||
}
|
||||
}
|
||||
steps('Deploy') {
|
||||
steps {
|
||||
dart pub publish
|
||||
git clone git@github.com:ariascreations/ServerCode
|
||||
rsync -a --progress -h --delete doc/api/ ServerCode/api.zontreck.com/dartdocs/libac/
|
||||
cd ServerCode
|
||||
git add --all .
|
||||
git commit -m "[BOT] Publish LibAC DartDocs"
|
||||
git push --all
|
||||
cd ..
|
||||
rm -rf ServerCode
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,8 @@ import 'dart:convert';
|
|||
|
||||
import 'package:libac_dart/utils/DictTools.dart';
|
||||
|
||||
import '../structs/Bitmasks.dart';
|
||||
|
||||
class User {
|
||||
String id;
|
||||
String username;
|
||||
|
@ -93,7 +95,7 @@ class User {
|
|||
}
|
||||
}
|
||||
|
||||
enum UserFlags {
|
||||
enum UserFlags implements MaskEnum {
|
||||
DiscordEmployee(1 << 0),
|
||||
PartneredServerOwner(1 << 1),
|
||||
HypeSquadEvents(1 << 2),
|
||||
|
@ -117,6 +119,23 @@ enum UserFlags {
|
|||
static UserFlags? decode(dynamic value) {
|
||||
if (value == null) return null;
|
||||
int flag = value as int;
|
||||
|
||||
for (var val in values) {
|
||||
if (val == flag) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
int getValue() {
|
||||
return flags;
|
||||
}
|
||||
|
||||
@override
|
||||
List<UserFlags> getValues() {
|
||||
return values;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
7
lib/structs/Bitmasks.dart
Normal file
7
lib/structs/Bitmasks.dart
Normal file
|
@ -0,0 +1,7 @@
|
|||
class BitMask {}
|
||||
|
||||
abstract class MaskEnum {
|
||||
int getValue();
|
||||
|
||||
List<MaskEnum> getValues();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue