Skip to content

Commit 94f72d2

Browse files
committed
Все примеры для Java Junior Developer
0 parents  commit 94f72d2

File tree

549 files changed

+36575
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

549 files changed

+36575
-0
lines changed

.github/workflows/ci.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'temurin'
27+
28+
- name: Detect build system and build
29+
run: |
30+
if [ -f pom.xml ]; then
31+
echo "BUILD_SYSTEM=maven" >> $GITHUB_ENV
32+
mvn -B clean compile -Dmaven.test.skip=true -Djava.awt.headless=true || true
33+
elif [ -f build.gradle ] || [ -f build.gradle.kts ]; then
34+
echo "BUILD_SYSTEM=gradle" >> $GITHUB_ENV
35+
chmod +x gradlew 2>/dev/null || true
36+
if [ -f gradlew ]; then
37+
./gradlew build -x test || true
38+
else
39+
gradle build -x test || true
40+
fi
41+
else
42+
echo "BUILD_SYSTEM=javac" >> $GITHUB_ENV
43+
echo "No Maven/Gradle found, compiling .java files directly"
44+
find . -name "*.java" -not -path "*/test/*" | head -50 | xargs javac -d /tmp/classes 2>&1 | tail -20 || true
45+
fi
46+
47+
- name: Run tests
48+
run: |
49+
if [ "$BUILD_SYSTEM" = "maven" ]; then
50+
mvn -B test jacoco:report -Djava.awt.headless=true || true
51+
elif [ "$BUILD_SYSTEM" = "gradle" ]; then
52+
if [ -f gradlew ]; then
53+
./gradlew test jacocoTestReport || true
54+
else
55+
gradle test jacocoTestReport || true
56+
fi
57+
else
58+
echo "No test runner configured"
59+
fi
60+
61+
- name: Show coverage summary
62+
run: |
63+
# Maven JaCoCo
64+
if [ -f target/site/jacoco/jacoco.csv ]; then
65+
echo "## Test Coverage Report (JaCoCo)" >> $GITHUB_STEP_SUMMARY
66+
echo '```' >> $GITHUB_STEP_SUMMARY
67+
awk -F',' 'NR>1 {missed+=$4; covered+=$5} END {total=missed+covered; if(total>0) printf "Line Coverage: %d/%d (%.1f%%)\nMissed: %d lines\n", covered, total, covered*100/total, missed; else print "No coverage data"}' target/site/jacoco/jacoco.csv >> $GITHUB_STEP_SUMMARY
68+
echo '```' >> $GITHUB_STEP_SUMMARY
69+
# Gradle JaCoCo
70+
elif [ -f build/reports/jacoco/test/jacocoTestReport.csv ]; then
71+
echo "## Test Coverage Report (JaCoCo)" >> $GITHUB_STEP_SUMMARY
72+
echo '```' >> $GITHUB_STEP_SUMMARY
73+
awk -F',' 'NR>1 {missed+=$4; covered+=$5} END {total=missed+covered; if(total>0) printf "Line Coverage: %d/%d (%.1f%%)\nMissed: %d lines\n", covered, total, covered*100/total, missed; else print "No coverage data"}' build/reports/jacoco/test/jacocoTestReport.csv >> $GITHUB_STEP_SUMMARY
74+
echo '```' >> $GITHUB_STEP_SUMMARY
75+
else
76+
echo "## Coverage" >> $GITHUB_STEP_SUMMARY
77+
echo "No JaCoCo report found. Add jacoco-maven-plugin or jacoco Gradle plugin." >> $GITHUB_STEP_SUMMARY
78+
fi
79+
80+
- name: Upload coverage to Codecov
81+
if: hashFiles('**/jacoco.xml') != ''
82+
uses: codecov/codecov-action@v4
83+
with:
84+
fail_ci_if_error: false
85+
env:
86+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
*.class
2+
3+
# Mobile Tools for Java (J2ME)
4+
.mtj.tmp/
5+
6+
# Package Files #
7+
*.jar
8+
*.war
9+
*.ear
10+
11+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
12+
hs_err_pid*
13+
14+
nbproject
15+
out
16+
17+
atlassian-ide-plugin.xml
18+
.DS_Store
19+
20+
private
21+
build
22+
dist
23+
out
24+
target
25+
26+
# Log-files
27+
*.log

CLAUDE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# java — Все примеры для Java Junior Developer
2+
3+
## Purpose
4+
5+
Demonstration project showing specific concepts and techniques. Use it as a reference.
6+
7+
## Prerequisites
8+
9+
- JDK 8+
10+
11+
## Build & Run
12+
13+
```bash
14+
# See project files for build instructions
15+
```
16+
17+
## Development Guidelines
18+
19+
### Code Style
20+
- Follow standard Java conventions
21+
- Keep code clean and well-organized
22+
- Use meaningful variable and method names
23+
24+
### Git Workflow
25+
- Write clear, descriptive commit messages
26+
- One logical change per commit
27+
- Test before committing
28+
29+
### Testing
30+
- Write tests for new functionality
31+
- Run the full test suite before pushing
32+
- Keep tests focused and independent

JOGL/JOGL_NeHe/pom.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>java</groupId>
8+
<artifactId>JOGL</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<properties>
12+
<jogl.version>2.6.0</jogl.version>
13+
</properties>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.jogamp.gluegen</groupId>
18+
<artifactId>gluegen-rt-main</artifactId>
19+
<version>${jogl.version}</version>
20+
</dependency>
21+
<dependency>
22+
<groupId>org.jogamp.jogl</groupId>
23+
<artifactId>jogl-all-main</artifactId>
24+
<version>${jogl.version}</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.jogamp.jocl</groupId>
28+
<artifactId>jocl-main</artifactId>
29+
<version>${jogl.version}</version>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.jogamp.joal</groupId>
33+
<artifactId>joal-main</artifactId>
34+
<version>${jogl.version}</version>
35+
</dependency>
36+
</dependencies>
37+
</project>

0 commit comments

Comments
 (0)