Skip to content

Commit 373a4f2

Browse files
authored
update all the things gradle,libraries,tests,version (#10)
1 parent 8bd9542 commit 373a4f2

34 files changed

Lines changed: 505 additions & 448 deletions

.github/workflows/build.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Java CI with Gradle
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: read
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up JDK 11
21+
uses: actions/setup-java@v3
22+
with:
23+
java-version: '11'
24+
distribution: 'zulu'
25+
- name: Build with Gradle
26+
uses: gradle/gradle-build-action@v2
27+
- name: Build
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
31+
run: ./gradlew build
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '40 1 * * 2'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
packages: read
32+
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
language: [ 'java' ]
37+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
38+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v3
43+
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v2
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v2
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
61+
62+
# ℹ️ Command-line programs to run using the OS shell.
63+
# 📚 https://git.io/JvXDl
64+
65+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
66+
# and modify them (or add more) to build your code if your project
67+
# uses a compiled language
68+
69+
#- run: |
70+
# make bootstrap
71+
# make release
72+
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v2

.github/workflows/gradle.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/publish.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish to GitHub Packages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-java@v3
17+
with:
18+
java-version: '11'
19+
distribution: 'zulu'
20+
- name: Publish with Gradle
21+
uses: gradle/gradle-build-action@v2
22+
- name: Publish
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
26+
run: ./gradlew publish

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ It supports the generation of Java based servers with the following flavours sup
1313

1414
### Requirements
1515

16-
The build has been tested with [Zulu's OpenJDK](https://www.azul.com/downloads/zulu-community/?architecture=x86-64-bit&package=jdk "JDK Downloads") (version 11)
16+
The build has been tested with [Zulu's OpenJDK](https://www.azul.com/downloads/#zulu "JDK Downloads") version 11.
1717

1818
The build uses gradle to generate the artifacts. No installation is required as the project uses the
1919
[gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html "gradle wrapper") setup.
2020

21-
For testing you will need an installation of the [protocol buffers compiler](https://github.com/google/protobuf/releases "protobuf releases").
21+
To test you will need an installation of the [protocol buffers compiler](https://github.com/protocolbuffers/protobuf/releases "protobuf releases").
2222

2323
### Modules
2424

@@ -37,20 +37,17 @@ The project is split into the following modules:
3737

3838
To build the various components, run the following:
3939

40-
git clone git@github.com:devork/flit.git
40+
git clone git@github.com:github/flit.git
4141
cd flit
42-
./gradlew clean build pack
42+
./gradlew clean build
4343

4444
### Installation
4545

4646
Currently, the run script only supports *nix but the run script should be fairly easy to migrate to windows.
4747

4848
After building:
4949

50-
cp plugin/build/package/flit-plugin.zip /usr/local/bin
51-
cd /usr/local/bin
52-
unzip flit-plugin.zip
53-
chmod +x protoc-gen-flit
50+
cp plugin/build/libs/plugin-all.jar /code/java-project/scripts/
5451

5552
## Running
5653

build.gradle

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,64 @@
1-
buildscript {
1+
plugins {
2+
id 'java-library'
3+
id 'maven-publish'
4+
id 'dev.poolside.gradle.semantic-version' version '0.1.5'
5+
}
6+
7+
allprojects {
8+
apply plugin: 'java-library'
9+
apply plugin: 'maven-publish'
10+
211
repositories {
3-
jcenter()
12+
mavenCentral()
13+
}
14+
15+
ext {
16+
// third party
17+
javapoetVersion = "1.13.0"
18+
javaxservletapiVersion = "4.0.1"
19+
javaxwsrsapiVersion = "2.1.1"
20+
protobufVersion = "3.22.2"
21+
slf4jVersion = "1.7.36"
22+
springVersion = "5.3.26"
23+
undertowVersion = "2.3.5.Final"
24+
25+
// testing
26+
approvaltestsVersion = "18.5.0"
27+
javaparserVersion = "3.25.2"
28+
jerseyCommonVersion = "2.22.2"
29+
junitJupiterVersion = "5.9.2"
30+
mockitoVersion = "5.2.0"
31+
}
32+
33+
java {
34+
group = "com.flit"
35+
targetCompatibility = JavaVersion.VERSION_11
36+
sourceCompatibility = JavaVersion.VERSION_11
37+
withSourcesJar()
38+
}
39+
40+
test {
41+
useJUnitPlatform()
42+
testLogging {
43+
events "passed", "skipped", "failed"
44+
}
445
}
46+
547
dependencies {
6-
classpath('org.eclipse.jgit:org.eclipse.jgit:4.6.0.201612231935-r')
48+
testImplementation(platform("org.junit:junit-bom:$junitJupiterVersion"))
49+
testImplementation('org.junit.jupiter:junit-jupiter')
750
}
8-
}
951

10-
import org.eclipse.jgit.lib.Repository
11-
import org.eclipse.jgit.storage.file.FileRepositoryBuilder
12-
13-
import java.time.Instant
14-
import java.time.ZoneOffset
15-
import java.time.format.DateTimeFormatter
16-
17-
static def scmInfo(String path) {
18-
FileRepositoryBuilder builder = new FileRepositoryBuilder()
19-
Repository repository = builder.setGitDir(new File("${path}/.git"))
20-
.readEnvironment()
21-
.findGitDir()
22-
.build()
23-
24-
def branch = repository.getBranch()
25-
def head = repository.resolve("HEAD")
26-
def revision = head == null ? "UNKNOWN" : head.name()
27-
def date = Instant.now().atOffset(ZoneOffset.UTC).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)
28-
def tstamp = Instant.now().atOffset(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"))
29-
30-
return [
31-
branch : branch,
32-
revision: revision,
33-
date : date,
34-
tstamp : tstamp
35-
]
52+
publishing {
53+
repositories {
54+
maven {
55+
name = "GitHubPackages"
56+
url = uri("https://maven.pkg.github.com/github/flit")
57+
credentials {
58+
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
59+
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
60+
}
61+
}
62+
}
63+
}
3664
}
37-
38-
project.ext.scm = scmInfo(rootDir.getAbsolutePath())

gradle/wrapper/gradle-wrapper.jar

1.72 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sat Sep 08 13:15:19 CDT 2018
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip

0 commit comments

Comments
 (0)