Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
930503d949
|
|||
|
728f117b46
|
|||
|
e5f375155a
|
|||
|
1b441c0a8d
|
|||
|
791861b21a
|
15
.gitignore
vendored
15
.gitignore
vendored
@@ -1,10 +1,7 @@
|
|||||||
### Gradle ###
|
# Gradle
|
||||||
/.gradle/
|
.gradle/
|
||||||
/build/
|
build/
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
# JetBrains IDEA
|
||||||
/.idea/libraries/
|
.idea/
|
||||||
/.idea/compiler.xml
|
*.iml
|
||||||
/.idea/jarRepositories.xml
|
|
||||||
/.idea/misc.xml
|
|
||||||
/.idea/modules.xml
|
|
||||||
|
|||||||
20
README.MD
20
README.MD
@@ -1,21 +1,19 @@
|
|||||||
# XmlElement
|
# XmlElement
|
||||||
|
|
||||||
|
## Использование
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
## Подключение к проекту
|
## Подключение к проекту
|
||||||
|
|
||||||
### Gradle
|
### Gradle
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
implementation("ru.di9:xml-element:1.0")
|
repositories {
|
||||||
|
maven { url "https://di9.ru/git/api/packages/Voomra/maven" }
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Сборка
|
```groovy
|
||||||
|
implementation("ru.di9:xml-element:1.2.1")
|
||||||
```shell
|
|
||||||
gradle build
|
|
||||||
```
|
|
||||||
|
|
||||||
## Установка в локальный Maven
|
|
||||||
|
|
||||||
```shell
|
|
||||||
gradle publishToMavenLocal
|
|
||||||
```
|
```
|
||||||
|
|||||||
27
build.gradle
27
build.gradle
@@ -1,3 +1,5 @@
|
|||||||
|
//file:noinspection GroovyAssignabilityCheck
|
||||||
|
//file:noinspection GrUnresolvedAccess
|
||||||
plugins {
|
plugins {
|
||||||
id "java-library"
|
id "java-library"
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
@@ -14,7 +16,7 @@ compileJava {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "ru.di9"
|
group = "ru.di9"
|
||||||
version = "1.2"
|
version = "1.2.1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
@@ -24,9 +26,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
api("it.unimi.dsi:fastutil:8.5.12")
|
api("it.unimi.dsi:fastutil:8.5.12")
|
||||||
|
|
||||||
def junit5_version = "5.9.2"
|
def junit5Version = "5.9.2"
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-api:${junit5_version}")
|
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit5Version")
|
||||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junit5_version}")
|
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit5Version")
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
@@ -43,4 +45,21 @@ publishing {
|
|||||||
from components.java
|
from components.java
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = "Di9"
|
||||||
|
url = uri("https://di9.ru/git/api/packages/Voomra/maven")
|
||||||
|
def giteaToken = System.getenv("GITEA_TOKEN")
|
||||||
|
|
||||||
|
credentials(HttpHeaderCredentials) {
|
||||||
|
name = "Authorization"
|
||||||
|
value = "token ${giteaToken}"
|
||||||
|
}
|
||||||
|
|
||||||
|
authentication {
|
||||||
|
header(HttpHeaderAuthentication)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,14 @@ public class XmlElement implements Iterable<XmlElement> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> getAttributeAsListString(String key) {
|
||||||
|
if (element.hasAttribute(key)) {
|
||||||
|
return Arrays.asList(element.getAttribute(key).split(","));
|
||||||
|
} else {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterator<XmlElement> iterator() {
|
public Iterator<XmlElement> iterator() {
|
||||||
return new XmlElementIterator(element.getChildNodes());
|
return new XmlElementIterator(element.getChildNodes());
|
||||||
|
|||||||
Reference in New Issue
Block a user