Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev#1 #100

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open

Dev#1 #100

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
5ce38df
Modified to Eclipse env
SiowYenChong Aug 11, 2023
08b1bdd
Adapted to Eclipse env
SiowYenChong Aug 11, 2023
d269cbc
# commit
AnoshaChohan Aug 17, 2023
509c5f7
implementing factorial feature
ayj69 Aug 20, 2023
dae8fe0
Revert "Adapted to Eclipse" commit
SiowYenChong Aug 20, 2023
285a447
test
ayj69 Aug 20, 2023
59075b9
test
ayj69 Aug 20, 2023
1148b7a
Revert "Revert "Adapted to Eclipse" commit"
ayj69 Aug 20, 2023
21a4657
implementing factorial
ayj69 Aug 20, 2023
6213418
Merge pull request #3 from SiowYenChong/dev#1
ayj69 Aug 20, 2023
96bc7d6
Corrected error: UI.java
SiowYenChong Aug 21, 2023
50a21db
commit changes
SiowYenChong Aug 21, 2023
70ab38c
Done testing factorial & Debug error sin,cos,tan
SiowYenChong Aug 21, 2023
653ed6e
Updated testing factorial & Debug error sin,cos,tan
SiowYenChong Aug 21, 2023
55bf69e
Merge pull request #4 from SiowYenChong/Tester
SiowYenChong Aug 21, 2023
df52390
Added Mod function
AnoshaChohan Aug 21, 2023
d8c0f3d
Saved changes
SiowYenChong Aug 30, 2023
7d4fccb
Saved changes
SiowYenChong Aug 30, 2023
781c4f5
Merged tester
SiowYenChong Aug 30, 2023
8abc836
Merge branch 'master' of https://github.com/SiowYenChong/Simple-Java-…
SiowYenChong Aug 30, 2023
ba72cec
Tester alterations
SiowYenChong Aug 30, 2023
2047f38
Added mod function
Aug 30, 2023
f6caeb1
commit
Aug 30, 2023
5bf3982
Updated mod
Aug 30, 2023
383e8e7
bfor pulling
SiowYenChong Aug 30, 2023
42ab587
bfor pulling
SiowYenChong Aug 30, 2023
f742438
Checked Mod Function
SiowYenChong Aug 30, 2023
c16828c
fixed conflicts
SiowYenChong Aug 30, 2023
1224a8d
Merge pull request #5 from SiowYenChong/dev#2
SiowYenChong Aug 30, 2023
ee30542
bfor switch to DevOps
SiowYenChong Sep 2, 2023
8394f31
Added jenkinfile
SiowYenChong Sep 2, 2023
3602dab
resolve conflict
SiowYenChong Sep 2, 2023
a511b49
resolve conflict
SiowYenChong Sep 2, 2023
0db4a21
lowercase repo
SiowYenChong Sep 2, 2023
1a3b317
Merge branch 'DevOps'
SiowYenChong Sep 2, 2023
e451699
Resolved conflicts
SiowYenChong Sep 2, 2023
633e733
Create eslint.yml
ayj69 Sep 4, 2023
279cf10
edit the factiruo button description
ayj69 Sep 4, 2023
e3f163d
Create pmd.yml
ayj69 Sep 4, 2023
5d373a1
Create codeql.yml
ayj69 Sep 4, 2023
70e156a
Delete .github/workflows/codeql.yml
ayj69 Sep 4, 2023
d3e8cdf
Merge pull request #9 from SiowYenChong/dev#1
ayj69 Sep 4, 2023
2a34b7c
Delete .github/workflows/eslint.yml
ayj69 Sep 4, 2023
0a8468b
Delete .github/workflows/pmd.yml
ayj69 Sep 4, 2023
c34c4d1
Create devskim.yml
ayj69 Sep 4, 2023
44297d7
edit the factorial button again
ayj69 Sep 4, 2023
9ef1844
Merge pull request #10 from SiowYenChong/dev#1
ayj69 Sep 4, 2023
5aa88b1
regenerate the build file so it can build
ayj69 Sep 5, 2023
b97748d
Merge branch 'master' into dev#1
ayj69 Sep 5, 2023
bd2ec7a
Merge pull request #11 from SiowYenChong/dev#1
ayj69 Sep 5, 2023
387d6cd
export, rebuild ant
SiowYenChong Sep 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
34 changes: 34 additions & 0 deletions .github/workflows/devskim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: DevSkim

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '32 13 * * 0'

jobs:
lint:
name: DevSkim
runs-on: ubuntu-20.04
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run DevSkim scanner
uses: microsoft/DevSkim-Action@v1

- name: Upload DevSkim scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: devskim-results.sarif
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
# Mac OS System
.DS_Store*
._*
/bin/
28 changes: 28 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SimpleJavaCalculator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1692244280313</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
2 changes: 2 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
15 changes: 15 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM jenkins/jenkins:2.401.3-jdk17
USER root

RUN apt-get update && apt-get install -y lsb-release
RUN curl -fsSLo /usr/share/keyrings/docker-archive-keyring.asc \
https://download.docker.com/linux/debian/gpg
RUN echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/usr/share/keyrings/docker-archive-keyring.asc] \
https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
RUN apt-get update && apt-get install -y docker-ce-cli

USER jenkins
RUN jenkins-plugin-cli --plugins "blueocean docker-workflow"
24 changes: 24 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
pipeline {
agent any
stages{
stage('Build docker image'){
steps{
script{
sh 'docker build -t siowyenchong/simple-java-calculator .'
}
}
}
stage('Push image to Hub'){
steps{
script{
withCredentials([string(credentialsId: 'dockerhub-pwd', variable: 'dockerhubpwd')]) {
sh 'docker login -u siowyenchong -p ${dockerhubpwd}'
}
sh 'docker push siowyenchong/simple-java-calculator'
}
}
}
}
}


Binary file added bin/module-info.class
Binary file not shown.
1 change: 1 addition & 0 deletions bin/resources/icon/icon-notice.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`icon.png`, all rights reserved by xdvrx1
Binary file added bin/resources/icon/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/simplejavacalculator/BufferedImageCustom.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/simplejavacalculator/Calculator.class
Binary file not shown.
Binary file added bin/simplejavacalculator/SimpleJavaCalculator.class
Binary file not shown.
Binary file added bin/simplejavacalculator/UI.class
Binary file not shown.
Binary file added bin/simplejavacalculatorTest/CalculatorTest.class
Binary file not shown.
139 changes: 67 additions & 72 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,73 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="SimpleJavaCalculator" default="default" basedir=".">
<description>Builds, tests, and runs the project SimpleJavaCalculator.</description>
<import file="nbproject/build-impl.xml"/>
<!--

There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:

-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products

(Targets beginning with '-' are not intended to be called on their own.)

Example of inserting an obfuscator after compilation could look like this:

<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>

For list of available properties check the imported
nbproject/build-impl.xml file.


Another way to customize the build is by overriding existing main targets.
The targets of interest are:

-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation

An example of overriding the target for project execution could look like this:

<target name="run" depends="SimpleJavaCalculator-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>

Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.

-->
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. --><project basedir="." default="build" name="SimpleJavaCalculator">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="17"/>
<property name="source" value="17"/>
<path id="JUnit 5.libraryclasspath">
<pathelement location="../../../../eclipse/plugins/junit-jupiter-api_5.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-jupiter-engine_5.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-jupiter-migrationsupport_5.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-jupiter-params_5.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-platform-commons_1.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-platform-engine_1.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-platform-launcher_1.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-platform-runner_1.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-platform-suite-api_1.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-platform-suite-engine_1.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-platform-suite-commons_1.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/junit-vintage-engine_5.9.3.jar"/>
<pathelement location="../../../../eclipse/plugins/org.opentest4j_1.2.0.jar"/>
<pathelement location="../../../../eclipse/plugins/org.apiguardian.api_1.1.2.jar"/>
<pathelement location="../../../../eclipse/plugins/org.junit_4.13.2.v20211018-1956.jar"/>
<pathelement location="../../../../eclipse/plugins/org.hamcrest.core_1.3.0.v20180420-1519.jar"/>
</path>
<path id="SimpleJavaCalculator.classpath">
<pathelement location="bin"/>
<path refid="JUnit 5.libraryclasspath"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="SimpleJavaCalculator.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
</project>
4 changes: 4 additions & 0 deletions build/built-jar.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Tue, 05 Sep 2023 11:04:50 +0800


C\:\\Users\\Clarr\\git\\Simple-Java-Calculator=
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3'
services:
jenkins:
container_name: jenkins
image: jenkins/jenkins:lts
ports:
- 8080:8080
- 50000:50000
volumes:
- jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
environment:
- JAVA_OPTS=-Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true
agent:
image: jenkins/ssh-agent:jdk11
container_name: agent
expose:
- 22
environment:
- JENKINS_AGENT_SSH_PUBKEY=ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDrI0OwiBlpK4FER5dMi2DwBs00FCdh1eGzvrNL1rIGhGyn+YUwXqCXEdTpCkA8lsjbbtUmDnRkPeCzTJpfOMcU+zBuQTUxS0txG1wotyGKWBEckd9giP4Z09JNKyftPdJEz0+YquN8KX1zS22l0hVZXHFQCSvbjaPu72D60752W9J0PdDSUfX7MdgJ/cDLD2IXguGcXVn/S3tLcdcoukFxsQ7zcaWkg3aF7rtFvuVQANb0B+h9KTxcQorJlDM4p4nkfiQEGxpijAh+p7Zi285kOt9OiJ3ButT4CnM5G6P2mhOxgLZX1InTGA07VTKGiGPp0Mrp2LzNKBDZdex4zNhDHmA3EiKGmKUHvHTcjA30md6VYqo7UB1S2BbCcmpDvcvtnplif8IyLfLq9qJb2vq71ItIho876MP3Kr7O4Ddh0zssuCMMtee2fnFpCtKRE4o2thlb/RM1vOKg0OvAo96Pl77HVuQm9RaTOe+PVk/63WLl5migG4THgbrXV+5HjCk=

volumes:
jenkins_home:
4 changes: 2 additions & 2 deletions nbproject/build-impl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ is divided into following sections:
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
<property name="default.javac.source" value="1.9"/>
<property name="default.javac.target" value="1.9"/>
</target>
<target depends="-pre-init,-init-private,-init-user" name="-init-project">
<property file="nbproject/configs/${config}.properties"/>
Expand Down
11 changes: 11 additions & 0 deletions src/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
*
*/
/**
*
*/
module SimpleJavaCalculator {
requires java.desktop;
requires junit;
requires org.junit.jupiter.api;
}
Loading