Adds in a jenkinsfile

This commit is contained in:
zontreck 2024-07-08 22:05:17 -07:00
parent bcaf02091f
commit 7f0bee7c28
3 changed files with 56 additions and 1 deletions

29
Jenkinsfile vendored Normal file
View 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
}
}
}
}

View file

@ -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;
}
}

View file

@ -0,0 +1,7 @@
class BitMask {}
abstract class MaskEnum {
int getValue();
List<MaskEnum> getValues();
}