Skip to content

Commit cbd639d

Browse files
author
m.r
committed
V1.0.1
1 parent 29295d4 commit cbd639d

Some content is hidden

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

61 files changed

+5767
-2852
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ bin/
4040
.vscode/
4141

4242
### Mac OS ###
43-
.DS_Store
43+
.DS_Store
44+
target

README.md

Lines changed: 3055 additions & 3 deletions
Large diffs are not rendered by default.

build-github.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ compileTestJava {options.encoding = "UTF-8"}
1010

1111

1212
group = 'io.github.mohammadrezaeicode'
13-
version = '0.1-SNAPSHOT'
13+
version = '1.0.1'
1414

1515
java {
1616
withJavadocJar()
@@ -53,8 +53,8 @@ publishing {
5353
// ]
5454
licenses {
5555
license {
56-
name = 'The Apache License, Version 2.0'
57-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
56+
name = 'The MIT License'
57+
url = 'https://github.com/mohammadrezaeicode/mr-excel-repo/blob/main/LICENSE'
5858
}
5959
}
6060
developers {

build.gradle

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ compileTestJava {options.encoding = "UTF-8"}
1111

1212

1313
group = 'io.github.mohammadrezaeicode'
14-
version = '0.1-SNAPSHOT'
14+
version = '1.0.1'
1515

1616
java {
1717
withJavadocJar()
@@ -35,6 +35,8 @@ publishing {
3535
publications {
3636
mavenJava(MavenPublication) {
3737
artifactId = "excel"
38+
group = 'io.github.mohammadrezaeicode'
39+
version = '1.0.1'
3840
from components.java
3941
versionMapping {
4042
usage('java-api') {
@@ -54,8 +56,8 @@ publishing {
5456
// ]
5557
licenses {
5658
license {
57-
name = 'The Apache License, Version 2.0'
58-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
59+
name = 'The MIT License'
60+
url = 'https://github.com/mohammadrezaeicode/mr-excel-repo/blob/main/LICENSE'
5961
}
6062
}
6163
developers {
@@ -72,17 +74,17 @@ publishing {
7274
}
7375
repositories {
7476
maven {
75-
url = version.endsWith('SNAPSHOT') ?
76-
"https://s01.oss.sonatype.org/content/repositories/snapshots/" :
77-
"https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
78-
79-
credentials {
80-
username = project.findProperty("ossrhUsername") // Load from gradle.properties
81-
password = project.findProperty("ossrhPassword") // Load from gradle.properties
82-
}
83-
// def releasesRepoUrl = layout.buildDirectory.dir('repos/releases')
84-
// def snapshotsRepoUrl = layout.buildDirectory.dir('repos/snapshots')
85-
// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
77+
// url = version.endsWith('SNAPSHOT') ?
78+
// "https://central.sonatype/content/repositories/snapshots/" :
79+
// "https://central.sonatype/service/local/staging/deploy/maven2/"
80+
//
81+
// credentials {
82+
// username = project.findProperty("ossrhUsername") // Load from gradle.properties
83+
// password = project.findProperty("ossrhPassword") // Load from gradle.properties
84+
// }
85+
def releasesRepoUrl = layout.buildDirectory.dir('repos/releases')
86+
def snapshotsRepoUrl = layout.buildDirectory.dir('repos/snapshots')
87+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
8688
}
8789
}
8890
}
@@ -105,23 +107,46 @@ tasks.withType(JavaCompile) {
105107
// classifier = 'sources'
106108
// from sourceSets.main.allSource
107109
//}
108-
//java {
109-
// toolchain {
110-
// languageVersion = JavaLanguageVersion.of(11)
111-
// }
112-
// withJavadocJar()
113-
// withSourcesJar()
110+
java {
111+
toolchain {
112+
languageVersion = JavaLanguageVersion.of(11)
113+
}
114+
withJavadocJar()
115+
withSourcesJar()
116+
117+
}
118+
119+
//javadoc {
114120
//
115121
//}
116122

117-
118123
signing {
119124
sign publishing.publications.mavenJava
120125
}
121126
//
122127
//
128+
//javadoc {
129+
// if(JavaVersion.current().isJava9Compatible()) {
130+
// options.addBooleanOption('html5', true)
131+
// exclude()
132+
// }
133+
// options {
134+
// addStringOption('Xdoclint:none', '') // Disable doclint warnings
135+
//
136+
// }
137+
// exclude('**/lombok/**')
138+
//}
139+
123140
javadoc {
124-
if(JavaVersion.current().isJava9Compatible()) {
141+
// options.addFileOption './src'
142+
options.encoding = 'UTF-8'
143+
if(JavaVersion.current().isJava9Compatible()) {
125144
options.addBooleanOption('html5', true)
145+
exclude()
126146
}
147+
// source = sourceSets.main.allJava
148+
// options {
149+
// addStringOption('Xdoclint', 'none') // Disable doclint warnings
150+
// excludes = ['**/lombok/**'] // Exclude Lombok classes
151+
// }
127152
}

pom.xml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>io.github.mohammadrezaeicode</groupId>
6+
<artifactId>excel</artifactId>
7+
<packaging>jar</packaging>
8+
<version>1.0.1</version>
9+
<name>excel</name>
10+
<url>https://github.com/mohammadrezaeicode/mr-excel-java</url>
11+
<description>A versatile Java library for effortlessly generating .xlsx files from input objects. Seamlessly create Excel spreadsheets with data, formatting, formulas, and more.</description>
12+
13+
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<maven.compiler.source>11</maven.compiler.source>
17+
<maven.compiler.target>11</maven.compiler.target>
18+
</properties>
19+
<licenses>
20+
<license>
21+
<name>The MIT License</name>
22+
<url>https://github.com/mohammadrezaeicode/mr-excel-repo/blob/main/LICENSE</url>
23+
</license>
24+
</licenses>
25+
<developers>
26+
<developer>
27+
<id>MohammadR</id>
28+
<name>Mohammad Rezaei</name>
29+
<email>[email protected]</email>
30+
</developer>
31+
</developers>
32+
<scm>
33+
<connection>scm:git:https://github.com/mohammadrezaeicode/mr-excel-java.git</connection>
34+
<developerConnection>scm:git:[email protected]:mohammadrezaeicode/mr-excel-java.git</developerConnection>
35+
<url>https://github.com/mohammadrezaeicode/mr-excel-java</url>
36+
</scm>
37+
38+
<dependencies>
39+
<dependency>
40+
<groupId>org.projectlombok</groupId>
41+
<artifactId>lombok</artifactId>
42+
<version>1.18.36</version>
43+
<scope>provided</scope>
44+
</dependency>
45+
<dependency>
46+
<groupId>junit</groupId>
47+
<artifactId>junit</artifactId>
48+
<version>3.8.1</version>
49+
<scope>test</scope>
50+
</dependency>
51+
</dependencies>
52+
<build>
53+
<plugins>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-source-plugin</artifactId>
57+
<version>2.2.1</version>
58+
<executions>
59+
<execution>
60+
<id>attach-sources</id>
61+
<goals>
62+
<goal>jar-no-fork</goal>
63+
</goals>
64+
</execution>
65+
</executions>
66+
</plugin>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-javadoc-plugin</artifactId>
70+
<version>2.9.1</version>
71+
<executions>
72+
<execution>
73+
<id>attach-javadocs</id>
74+
<goals>
75+
<goal>jar</goal>
76+
</goals>
77+
</execution>
78+
</executions>
79+
</plugin>
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-gpg-plugin</artifactId>
83+
<version>1.5</version>
84+
<executions>
85+
<execution>
86+
<id>sign-artifacts</id>
87+
<phase>verify</phase>
88+
<goals>
89+
<goal>sign</goal>
90+
</goals>
91+
</execution>
92+
</executions>
93+
</plugin>
94+
<plugin>
95+
<groupId>org.sonatype.central</groupId>
96+
<artifactId>central-publishing-maven-plugin</artifactId>
97+
<version>0.7.0</version>
98+
<extensions>true</extensions>
99+
<configuration>
100+
<publishingServerId>central</publishingServerId>
101+
</configuration>
102+
</plugin>
103+
</plugins>
104+
</build>
105+
</project>
Lines changed: 2 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,10 @@
11
package io.github.mohammadrezaeicode.excel;
22

3-
import io.github.mohammadrezaeicode.excel.function.GenerateExcel;
4-
import io.github.mohammadrezaeicode.excel.model.ExcelTableOption;
5-
import io.github.mohammadrezaeicode.excel.model.Result;
6-
import io.github.mohammadrezaeicode.excel.model.test.OB;
7-
import io.github.mohammadrezaeicode.excel.model.types.GenerateType;
83

9-
import java.io.*;
4+
import java.io.IOException;
105
import java.lang.reflect.InvocationTargetException;
11-
import java.util.Arrays;
12-
import java.util.Optional;
136

14-
public class Main {
7+
public class Main {
158
public static void main(String[] args) throws IOException, InvocationTargetException, IllegalAccessException {
16-
17-
// ExcelTable1 excelTable1= ExcelTable1.builder()
18-
// .sheet(Arrays.asList(
19-
// Sheet1.builder()
20-
// .data(Arrays.asList(new OB("er","gdh","gfdh")))
21-
// .headers(
22-
// Process.findAnnotation(OB.class)
23-
// )
24-
// .build()
25-
// ))
26-
// .build();
27-
// System.out.println(Process.findAnnotation(OB.class));
28-
try {
29-
// var map=GenerateExcel.generateExcel(excelTable1,"");
30-
// System.out.println(map.size()+"***********");
31-
// FileUtils.writeFile("new-test-x", );
32-
// System.out.println( );
33-
Result<InputStream> data= GenerateExcel.generateHeaderAndGenerateExcel(Arrays.asList(
34-
new OB("er","gdh","gfdh"),
35-
new OB("er1","gdh2","gfd4h"),
36-
new OB("er2","gdh3","gfdh5")
37-
), ExcelTableOption.eBuilder()
38-
.fileName("this is by name")
39-
.notSave(false)
40-
.generateType(GenerateType.INPUT_STREAM)
41-
.build(),null,null);
42-
// saveZipToFile(ConverterUtil.inputStreamToByteArray(data.getFileData()),"INPUT_STREAM.xlsx");
43-
}catch (Exception ex){
44-
ex.printStackTrace();
45-
System.err.println(ex);
46-
}
47-
// FileUtils.base64();
48-
// Map<String, StyleBody> map=new HashMap<>();
49-
// map.put("head",new StyleBody(null,null,null,null,null,null,null,null,null,null,null,null,
50-
// "9A3B3B"));
51-
// Map<String, StyleBody> map2=new HashMap<>();
52-
// map2.put("head",new StyleBody(null,null,null,null,null,null,null,null,null,null,null,"FFF2D8",
53-
// "432143"));
54-
//
55-
// GeneralConfig.setConfig(GeneralConfig.ConfigType.Root,"test", GeneralConfig.FieldName.styles,map);
56-
// GeneralConfig.setConfig(GeneralConfig.ConfigType.Sheets,"test", GeneralConfig.FieldName.headerStyleKey,"head");
57-
// GeneralConfig.setConfig(GeneralConfig.ConfigType.Root,"test", GeneralConfig.FieldName.styles,map2);
58-
//
59-
//// FileUtils.writeFile("");
60-
//// var ob=new OB("er","gdh","gfdh");
61-
//// Process.findAnnotation(ob);
62-
//// Process.processList(Arrays.asList(new OB("test","test1","test23")));
63-
// ExcelTable table= Process.generateExcelTable(Arrays.asList(new OB("test","test1","test23")));
64-
// GeneralConfig.applyConfig("test",table);
65-
//// table.setStyles(map);
66-
//// table.getSheet().get(0).setHeaderStyleKey("head");
67-
// Map<String,String> mapr= GenerateExcel.generateExcel(table);
68-
// FileUtils.writeFile("aftermissup",mapr);
69-
70-
}
71-
72-
73-
// Method to save the ZIP byte array to a file
74-
private static void saveZipToFile(byte[] zipData, String filePath) {
75-
try (FileOutputStream fos = new FileOutputStream(filePath)) {
76-
fos.write(zipData); // Write the byte array to the file
77-
System.out.println("ZIP file saved successfully to " + filePath);
78-
} catch (IOException e) {
79-
e.printStackTrace();
80-
}
819
}
8210
}

src/main/java/io/github/mohammadrezaeicode/excel/annotation/Options.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
@Retention(RetentionPolicy.RUNTIME)
88
public @interface Options {
99
String title() default "";
10+
int order() default -1;
1011
}

0 commit comments

Comments
 (0)